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

Re: local $@ has an unwanted side effect

Thread Previous | Thread Next
From:
Zefram
Date:
March 21, 2008 09:57
Subject:
Re: local $@ has an unwanted side effect
Message ID:
20080321165723.GB18915@fysh.org
Abigail wrote:
>Inspecting $@ to check whether an eval die()d is wrong. It can
>trigger both false positives, and false negatives:

By that logic, there is no way at all to determine what exception
was thrown.  It's not a practical approach.

The possibility of DESTROY functions clobbering $@ is a design bug.
I suggest that $@ should be automatically preserved across (localised
to) DESTROY functions, and in the absence of such a change to the core
I have argued for all DESTROY functions to explicitly localise $@ and
the other global status variables.

-zefram

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