einerwitzen has asked for the wisdom of the Perl Monks concerning the following question:
I know people are telling me not to use die print "", but is there another way for the die error to print to the screen when viewed by an internet browser (IE) ? thanks all!#!/usr/bin/perl -w print "Content-type: text/html\n\n"; opendir(DIR,"./") || die print "Couldn't open directory"; my @unsfiles = readdir(DIR); closedir(DIR); @files = sort(@unsfiles); my $filename = __FILE__; my @noshow = (".", "..", $filename); print <<html; <html> <body> <div style=\"{ border: solid 1 #003366; background: #F1F1F1; text-align: left; padding: 4px; width: 200px; }\"> html foreach $f (@files) { unless (grep /$f/, @noshow) { print "<a style=\"{font-size: 13px; color: #000000;\"} href=\"./rea +d_file.cgi?file=$f\">$f</a><br>\n"; } } print <<html2; </div> </body> </html> html2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: more with directory contents
by Chmrr (Vicar) on Jan 14, 2002 at 17:33 UTC | |
|
the second part
by erroneousBollock (Curate) on Jan 14, 2002 at 18:46 UTC | |
|
Re: more with directory contents
by Marcello (Hermit) on Jan 14, 2002 at 17:43 UTC |