Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$lines = 0; open (DATABASE, "$filename" || &ErrorMessage); while (sysread DATABASE, $buffer, 4096) { $lines += ($buffer =~ tr/\n//); } close(DATABASE); if ($lines == 0){ &NoReport; } sub NoReport { print "Content-type: text/html\n\n"; print<<EOL; <html> <head> <title>No Report</title> </head> <body bgcolor="white"> <h2> No information has been submitted for the report you have requested. </h2> </body> </html> EOL exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: subroutine not working
by runrig (Abbot) on Sep 11, 2001 at 01:08 UTC |