In general, to debug, you will find that
1. Running from the command line is more useful than running via your browser and the webserver
2. If the command line won't tell you what's wrong, the perl debugger will:perl -d yourscript.cgi (see the perldebug manpage for how it works).
3. Sometimes, you do need to run via a browser (to get environment variables etc. right) and then CGI::Carp has a useful function called fatalsToBrowser:
use CGI::Carp qw/fatalsToBrowser/;
will show you runtime errors in your browser. (Not sure if it'll do the same for compilation errors tho.)
Mmkay?
dave
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.