A bit off-topic, but related:

Another thing which often causes problems is being having trouble debugging the scripts once they run properly. Debugging from the command line can be tedious, or, in the case of scripts that with high security or requiring cookies, virtually impossible without sprinkling your code with a bunch of print statements.

To solve that problem, I once hacked together a module that allowed one to easily dump CGI variable data to the browser. It was a cheap hack designed for my personal use, but I put it on this site in case anyone could use it. It has full POD included, but it does have a couple of problems.

Currently, I am working on Version 3.01 of the module. It will return the table instead of printing it directly (which it should have done in the first place). Also, if you specify a filename when instantiating the object, it writes the data to an HTML document with said filename. Run the the main script, switch to a browser pointing to the debugging HTML document and hit refresh. Voilá, as many tables as you like, with all variables that you'd like to examine. The module uses Data::Dumper for formatting data.

If any monks are interested in the new version (bugs and all), I'd be happy to provide them with a zipped copy. If I ever get the time to return to it and finish it up, I'll create a proper tar archive with tests that one can run "make" on.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re: Catching CGI Errors by Ovid
in thread Catching CGI Errors by nashdj

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.