Front page | perl.perl5.porters |
Postings from September 1999
Re: deprecating SIGDIE
Thread Previous
|
Thread Next
From:
Graham Barr
Date:
September 30, 1999 08:58
Subject:
Re: deprecating SIGDIE
Message ID:
19990930105220.F22419@adsl32.static36.directlink.net
On Thu, Sep 30, 1999 at 05:43:01PM +0200, Raphael Manfredi wrote:
> Quoting gbarr@pobox.com:
> :IMO, eval should just do the local($SIG{__DIE__})
>
> Upon pondering, I prefer Tom's approach. __DIE__ is meant for exactly that.
> A last chance to catch a die at the application level. Support for
> post-processing to allow for rich exception handling/tracing needs to
> be addressed though, so that people can convert all their existing code that
> presently abuses the __DIE__ semantics.
The way I see it is that if eval{} did a local() then code which currently
does
eval { ... };
if ($@) { ... }
could be written as
eval { $SIG{__DIE__} = \&handler; ... };
and the $@ test is not needed. This may have some advantages, but may not.
I also think that this would solve the problem that Tom is attempting to solve
which is action at a distance.
But also there are times when a whole app is run inside an eval {}, maybe it is
embedded or something, But SIGDIE is still wanted. Tom's fix just disables the calling
of the handler if inside an eval and I do not like that approach.
--
For myself I am an optimist--it does not seem to be much use being
anything else. -- Winston Churchill
Thread Previous
|
Thread Next