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

Re: local $@ has an unwanted side effect

Thread Previous | Thread Next
March 21, 2008 09:57
Re: local $@ has an unwanted side effect
Message ID:
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.


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