elvaaa
asked on
How to print a file
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.ht ml
if date = 02 then
print file=/home/www/mydir/dates -dir/02.ht ml
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,
<!-- exec cgi="myfile.cgi" -->
and this output goes like this
if date = 01 then
print file=/home/www/mydir/dates
if date = 02 then
print file=/home/www/mydir/dates
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,
#!/usr/local/bin/perl
$date=[ I don't know where you get the date from? ];
$file="/home/www/mydir/dat es-dir/".s printf("%0 2d",$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
$date=[ I don't know where you get the date from? ];
$file="/home/www/mydir/dat
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
ASKER
YES thank you thoellri! It does work. Post an answer! You are great!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER