Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: CGI script makes Internal Server-error

by DamnDirtyApe (Curate)
on Aug 29, 2004 at 22:48 UTC ( #386812=note: print w/ replies, xml ) Need Help??


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:
    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
    I find this style much more comfortable for blocks of text.
  • 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


Comment on Re: CGI script makes Internal Server-error
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://386812]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (16)
As of 2014-07-28 19:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (207 votes), past polls