|Pathologically Eclectic Rubbish Lister|
Re^2: RFC: Lexical Fatal.pm for Perl 5.10by pjf (Curate)
|on Mar 09, 2008 at 08:47 UTC||Need Help??|
maybe use lethal; makes more sense.
I love the suggestion. Thank-you! Project named internally to 'lethal'. ;)
It would be nice if the lexical module took care of installing and backing out the exception handler.
While I appreciate the desire here, I'd argue that lethal is the wrong place to do it. I expect most Perl developers are used to seeing exception handling occur at the bottom of code. In traditional Perl 5:
Or when using the Error module:
In both cases (and in most languages), the exceptions are handled at the end, or in the calling code. I'd certainly be surprised to see the exception handler before the code that may throw the exception.
However I will be mindful to ensure that lethal inherits cleanly, so this can be implemented easily in a child module if you think it's a good idea. ;)
Many thanks for the excellent ideas,
Perl Training Australia