in reply to Re: return eval { die() } idiom
in thread return eval { die() } idiom
sub x { # stuff eval { # eval-ed stuff }; if ($@) { die $@ unless UNIVERSAL::isa($@, 'ErrorOrSignalThatICanHandleH +ere'); # Handle the error/signal types I can handle here however I se +e fit }; return 1; }
Of course, this assumes a library of error and signal classes, but, then again, if you're using eval-die as a throw-catch mechanism, you would have those, right?
------
We are the carpenters and bricklayers of the Information Age.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|