Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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

In reply to Re: CGI script makes Internal Server-error by DamnDirtyApe
in thread CGI script makes Internal Server-error by reaction

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found