develooper Front page | perl.perl5.porters | Postings from June 2008

Re: Why $@ makes me cry (was Re: Generic system() replacements)

Thread Previous | Thread Next
David Nicol
June 25, 2008 13:00
Re: Why $@ makes me cry (was Re: Generic system() replacements)
Message ID:
On Wed, Jun 25, 2008 at 2:07 PM, Ben Morrow <> wrote:

> Quite apart from that, exception objects will no longer be destroyed at
> the usual time (when the next exception is thrown). Indeed, unless user
> code takes the trouble to explicitly clear @@ (which no code written to
> date will, obviously), all exception objects will last forever. This
> seems like a bad idea...

not when $@ is cleared by the next eval?

if the PROPAGATE approach was extended to clearing as well as adding,
and $@ built from the array as needed, the problem of $@ being cleared
by an eval within a DESTROY would be solved.  Outside of DESTROY,
there would be no effect.  This would have the same effect as
localizing $@ before destruction and preserving PROPAGATE semantics.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About