Hey all,
Unfortunately, I can't get to my logs so I'm relying on you guys and gals. Why is the following giving me an error?
#!/usr/bin/Perl -wT
print "Content-type:text/html\n\n";
open(fileIN,"log.txt") or dienice("Cannot open log.txt: $!");
@logData = <fileIN>;
close(fileIN);
print <<EndHTML;
<html>\n<head>\n
<title> Log File Data </title>\n
</head>\n<body>\n
<h2>Log File Data</h2>\n
EndHTML
foreach $line (@logData)
{
chomp($line);
print "$line<br>\n";
}
print "</body>\n</html>";
# Error Trapping Sub...should things go pear shaped!
sub dienice
{
my($msg) = @_;
print "<html>\n<head>\n<title>Error Opening File!</title>\n";
print "</head>\n";
print "<body><h2>Error</h2>\n<b>";
print $msg;
print "\n</b></body>\n</html>";
exit;
}
Thanks. BTW, all the necessary ingrediants are there, so I think it's a syntax thing.
- MT
Matt Torbin
Web and Graphic Arts Engineer
PEI-Genesis
aim: dgtlby
direct email: mtorbin_at_earthlink.net
Unfortunately, I can't get to my logs so I'm relying on you guys and gals. Why is the following giving me an error?
#!/usr/bin/Perl -wT
print "Content-type:text/html\n\n";
open(fileIN,"log.txt") or dienice("Cannot open log.txt: $!");
@logData = <fileIN>;
close(fileIN);
print <<EndHTML;
<html>\n<head>\n
<title> Log File Data </title>\n
</head>\n<body>\n
<h2>Log File Data</h2>\n
EndHTML
foreach $line (@logData)
{
chomp($line);
print "$line<br>\n";
}
print "</body>\n</html>";
# Error Trapping Sub...should things go pear shaped!
sub dienice
{
my($msg) = @_;
print "<html>\n<head>\n<title>Error Opening File!</title>\n";
print "</head>\n";
print "<body><h2>Error</h2>\n<b>";
print $msg;
print "\n</b></body>\n</html>";
exit;
}
Thanks. BTW, all the necessary ingrediants are there, so I think it's a syntax thing.
- MT
Matt Torbin
Web and Graphic Arts Engineer
PEI-Genesis
aim: dgtlby
direct email: mtorbin_at_earthlink.net