Solved

How to print a file

Posted on 1999-01-14
4
176 Views
Last Modified: 2010-03-05
How should I print a file through a SSI HTML document.
<!-- exec cgi="myfile.cgi" -->

and this output goes like this

if date = 01 then
print file=/home/www/mydir/dates-dir/01.html
if date = 02 then
print file=/home/www/mydir/dates-dir/02.html

where the 02.html is going to be inserted as a content inside of the of a SSI HTML document on the fly.

if possible can you show some Perl code to accomplish this task?

Thank you,
 
0
Comment
Question by:elvaaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:elvaaa
ID: 1207545
Adjusted points to 50
0
 
LVL 5

Expert Comment

by:thoellri
ID: 1207546
#!/usr/local/bin/perl
$date=[ I don't know where you get the date from? ];
$file="/home/www/mydir/dates-dir/".sprintf("%02d",$date).".html";
die "Can't read $path - $!" unless -r $file;
open(F,"<$file");
while(<F>) {
   # You can do some more stuff here with the file
   print;
}
close(F);

Hope this helps
  Tobias

0
 

Author Comment

by:elvaaa
ID: 1207547
YES thank you thoellri! It does work. Post an answer! You are great!
0
 
LVL 5

Accepted Solution

by:
thoellri earned 50 total points
ID: 1207548
Answer above ....

Cheers
  Tobias
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending email via Perl on Windows 3 195
syslog unix file 20 79
iSeries PERL Scripts 7 185
Formatting stings with pack and printf in perl 5 79
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question