Lately, I've been fine-tuning a module that I've been working on that allows easy debugging of cgi variables. This module has saved me many hours of work on CGI scripts and it occurred to me that a CPAN submission might be in order. However, I thought I would bounce a few thoughs off of my fellow Monks first.

As far as I can tell, there is no other module out there that duplicates the functionality of this module. CGI::Debug comes close, but is better suited debugging the CGI environment, where I am trying to facilitate debugging the variables themselves. In my experience, once the debugging of the environment is complete, the vast majority of the of debugging that is done is finding out what values are being passed where. Seeing that $index is undef tells me volumes about my logic.

CGI::DebugVars allows for conditions to be set up (e.g. don't print output unless $someVar eq $someVal), globally disabling all DebugVars statements (very handy once you think the script is close to production), and a variety of other features to fine-tune its behavior.

For example, let's say you want to print the contents of %some_hash, figure out what you've put into your $query object, examine the contents of $x, allow the CGI script to continue running, but only if $x is greater than 3:

DebugVars( SomeHash => \%some_hash, CGIObject => $query, X => $x, -continue => 1, -condition => "$x > 3" );
In the above example, you can add -continue => 0 to kill the script if DebugVars is encountered (but only if the condition, if used, is true), or simply omit the -continue key, as the default is false. You can also add -active => 0 to selectively turn off a DebugVars without going through the hassle of commenting and uncommenting it every time. To turn off 20 DebugVars statements, just toss this in the beginning of the script:
$CGI::DebugVars::Disable = 1;
The POD needs a a bit of work and I am considering adding a -package feature that would dump all values in a package's namespace to a table.

My Questions:

Is it worthy of CPAN? I know that much could be done with it, but it is so configurable and has saved me so many hours of debugging that I imagine others would appreciate it. I thought at first that it was rather piddly, but after seeing Bone::Easy, Sex and other modules on CPAN, I can hardly imagine that this would be the least usefule module out there :)

From the submission guidines:

Contact the author of an existing module and ask whether your new features would fit into his framework.
Should I contact the author of CGI::Debug? The concept of my script is actually something that might be useful in non-CGI programs, but I have tailored it to use the CGI module because this is most of the Perl work that I do. Since it is not really specific to the CGI environment (other than creating tables), it seems to be comparing apples and oranges... though I acknowledge their relation.

And yes, I would be checking http://www.xray.mpe.mpg.de/mailing-lists/modules/ before actually submitting anything.

Any and all suggestions welcome, even if you tell me I'm wasting time :)

Cheers,
Ovid

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


In reply to CPAN Submissions by Ovid

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.