develooper Front page | perl.perl5.porters | Postings from October 1999

Re: deprecating SIGDIE

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
October 1, 1999 10:53
Subject:
Re: deprecating SIGDIE
Message ID:
19991001135305.A1631@monk.mps.ohio-state.edu
On Fri, Oct 01, 1999 at 11:44:56AM +0100, Nick Ing-Simmons wrote:
> Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
> 
> 
> >What about  __EXCEPTION__ for
> >the semantic of "old" __DIE__?
> 
> Sigh. Does this mean I would then have to do : 
> 
> eval { local $SIG{__EXCEPTION__}; # protect against 5.6 style
>        local $SIG{__DIE__};       # protect against 5.005 style
>        ...
>        die "__Tk_break__\n" if (some_condition)
>        ...
>      };
> 
> if ($@ eq "__Tk_break__\n")

Exactly the opposite.

Current situation: as Larry said, you do not need to protect against
__DIE__.  __DIE__ handler *should not* step on other people's $@.  The
above thing is the *responsibility* of __DIE__ handler writers.

However, this "should not" requires some additional work from the
__DIE__ handler writers.  The above 'local' is in recognition of
possibility of potentially buggy __DIE__.

Providing __EXCEPTION__ allows one 

  a) either document extremely strict requirements on the code;
  b) or make $@ local inside __EXCEPTION__, in pseudocode:
	  local $@ = $@;
	  $SIG{__EXCEPTION__}->();

Ilya

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About