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

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

Thread Previous | Thread Next
From:
David Nicol
Date:
June 25, 2008 13:00
Subject:
Re: Why $@ makes me cry (was Re: Generic system() replacements)
Message ID:
934f64a20806251300s3e1f3eccjf74d12af6edbbd4f@mail.gmail.com
On Wed, Jun 25, 2008 at 2:07 PM, Ben Morrow <ben@morrow.me.uk> 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


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