[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: $^S and eval
>Tom Christiansen wrote:
>> Due to an implementation glitch, the C<$SIG{__DIE__}> hook is called
>> even inside an eval(). Do not use this to rewrite a pending exception
>> in C<$@>, or as a bizarre substitute for overriding CORE::GLOBAL::die().
>> This strange action at a distance may be fixed in a future release
>> so that C<$SIG{__DIE__}> is only called if your program is about
>> to exit, as was the original intent. Any other use is deprecated.
>Fair enough. What, then, would be the most legitimate way of
>(effectively) subclassing C<die> for a script?
C<die> is not a class, so I don't understand what "subclassing" it
should mean. Do you mean, how do you catch an uncaught die? You
wrap it with an eval and look at $@. Do you mean how do you replace
the CORE die with your own function? That's done by importing
into CORE::GLOBAL::die. Sounds like you are trying to discard
Perl's exception-handling system and write your own, which sounds
like it falls under "Any attempt to build a general exception model
on [$SIG{__DIE__}] should be politely squashed."
--tom
- Follow-Ups from:
-
Pete Jordan <pjordan1@email.mot.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]