Re: LWP and SIG traps not playing well together!

Chip Salzenberg (chip@atlantic.net)
Wed, 28 May 1997 13:17:15 -0400 (EDT)


According to Raphael Manfredi:
> Quoting Chip Salzenberg:
> :According to Gisle Aas:
> :> There are perhaps other places within the standard perl library which
> :> need protection against $SIG{__DIE__}?
> :
> :IMO, eval STRING and eval BLOCK should automatically localize
> :@SIG{'__WARN__','__DIE__'}.
> 
> If you mean localizing and yet retaining the current value (i.e. make
> further changes go away when the scope is left), then I agree.

No, I mean the equivalent of C< local $SIG{__DIE__} >, which resets
the die handler for the duration of the eval.  (Forget __WARN__, it
was a mistake to involve it in this issue.)

Consider that the whole *point* of eval BLOCK is to trap die().  Why,
then, should we allow the die() inside the eval to call a handler that
is intended, not for the eval, but for the surrounding code?
-- 
Chip Salzenberg           - a.k.a. -             <chip@pobox.com>
 "Vacation time.  Families travel east, west, north, or south."
 "Some just burrow straight down." -- Crow T. Robot   // MST3K