in reply to CGI script makes Internal Server-error
Since you've stated that you're fairly new to Perl, allow me to make some additional suggestions:
- Always use strict, unless you know precisely why not to. This will require you to declare all of your variables with my, eg. my $cgi = new CGI;
- Only use lib qw(.); if you actually need to load some modules from the current directory (which you're not doing in this script.)
- Rather than the lengthy strings your using to set your page header
and footer, consider using a heredoc, like so:
I find this style much more comfortable for blocks of text.my $WEBPAGE_INITIALIZE = <<'END_OF_HTML'; <html> <body bgcolor="#000000" text="#ffffff" link="#ffffff" vlink="#ffffff +" alink="#ffffff"> <font face="Arial" color="#000000"> <center> <table border="0" width="400" cellspacing="20" cellpadding="20 +"> <tr> <td> <center> <h5> END_OF_HTML my $WEBPAGE_SHUTDOWN = <<'END_OF_HTML'; </h5> </center> </td> </tr> </table> </center> </font> </body> </html> END_OF_HTML - Do away with the error_page_exit() function, and just use die() instead; that's what use CGI::Carp qw(fatalsToBrowser) is for.
Hope you find that helpful.
_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who would like to seem profound to the crowd strive for obscurity. --Friedrich Nietzsche
In Section
Seekers of Perl Wisdom