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:
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:DebugVars( SomeHash => \%some_hash, CGIObject => $query, X => $x, -continue => 1, -condition => "$x > 3" );
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.$CGI::DebugVars::Disable = 1;
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: CPAN Submissions
by clemburg (Curate) on Nov 03, 2000 at 04:21 UTC | |
|
RE: CPAN Submissions
by AgentM (Curate) on Nov 03, 2000 at 06:08 UTC | |
|
RE: CPAN Submissions
by Rudif (Hermit) on Nov 07, 2000 at 04:53 UTC |