I'd still say go with -w; you're not going to change how your CGI runs, but being able to catch uninitialized values now means that when you might expand or debug a new part of the script, you won't be bitten by problems. Most of the fixes where you have uninitialized values probably mean you need to do things like
$value = $cgi->param( 'field' ) || ''; as to clean the uninitialized portion out.
And, perl -wT and 'use strict' are good habits to get into now, particularly as a CGI author, as repeated countless times here.
To actually do this, I'd put on -w for a script, check it from the command line, then modify as needed; repeat for all scripts. Then, watch the error.log file as there will still be warnings that were not seen during compilation that might be obtained during runtime, and fix these; this latter step may take several weeks or months to completely do because of how the site gets used.
Very much alternatively, you could have a script that when the logs are archived out, you can strip all lines with that warning on them, as to shorten the text file. Of course, ignoring such an error may result in something worse in the future.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.