bsb has asked for the wisdom of the Perl Monks concerning the following question:
There's detailed documentation on the link above but the basic idea of the module is to install signal handlers that print the source code around lines giving rise to exceptions or warnings. It can be used in the command-line with -d:file although I'd like it to be safe to leave in your PERL5OPT while developing.
I asked about die/warn signal handler best practice questions already, interacting with other handlers is still a tricky business. The alpha version tries to play well with others but I'm swinging towards refusing to install if there's already another custom handler. Thoughts?
Other questions that I'm pondering are:
Should warnings be intercepted?
Should user exceptions such as croak be intercepted?
What about stack dumps?
(Note that the __DIE__ handler is called just before the program ending,
so shouldn't interfere with exception handling)
How many lines of context should be shown?
Should the source be appended to all errors, or inserted after each?
I received a suggestion to only show context for the first syntax error
as it's often the source of later problems, agree?
Currently, I use the source available from the debugger when -d is
used and fallback to using IO::All otherwise. Is it worth trying to
support the two, even though there will inevitably be differences?
Other suggestions and tips welcome.
Notes on the name
-d:file was a difficult choice, the other contenters included:-d:brief -d:flower -d:mote -d:spair -d:vic +e -d:ceased -d:form -d:notation -d:spise -d:vil -d:code -d:fuse -d:nouement -d:spot -d:voi +d -d:cry -d:grade -d:parts -d:tail -d:vot +e -d:duce -d:light -d:press -d:ter -d:fault -d:lineate -d:range -d:test -d:feat -d:mean -d:ride -d:velope -d:fect -d:mented -d:sist -d:viant
Brad
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Designing Defaults for Devel::file
by moritz (Cardinal) on Nov 04, 2007 at 09:45 UTC | |
Re: Designing Defaults for Devel::file
by bibliophile (Prior) on Nov 05, 2007 at 14:47 UTC |