CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [KevinR] Fomatting report: Edit Log



passat
Novice

May 17, 2005, 10:27 AM


Views: 3132
Re: [KevinR] Fomatting report

However, script creates main.log file, and weblog.pl show html page, but empty.

Probabaly, there are missing path to logfile in that code:

$mainlog = '/mnt/web_c/d31/s02/a000ras1/www/main.log';

it should be with path to logfile specified?



Code
 #!/usr/bin/perl  
# weblog.pl
# version 1.0
#
# read the file and format for display in a web browser


$mainlog = '/mnt/web_c/d31/s02/a000ras1/www/main.log';

print "Content-type: text/plain\n\n ";
print "<html><head><title>Web Report</title></head>\n";
print "<body bgcolor=\"#FFFFFF\">";
print "<h4>Web Report</h4>\n";
print "<pre style=\"font: normal #000000 'Courier New';\">";

open (MAINLOG, "$mainlog") or die "$!";
while (<MAINLOG>) {
print;
}
close (MAINLOG);
print "</pre></body></html>";
exit;



(This post was edited by passat on May 18, 2005, 4:42 AM)


Edit Log:
Post edited by passat (Novice) on May 18, 2005, 4:42 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives