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

Re: local $@ has an unwanted side effect

Thread Previous | Thread Next
From:
David Nicol
Date:
March 21, 2008 16:19
Subject:
Re: local $@ has an unwanted side effect
Message ID:
934f64a20803211619u4c4d0469w376a9228b9e08acd@mail.gmail.com
On Fri, Mar 21, 2008 at 6:13 PM, Mark Mielke <mark@mark.mielke.cc> wrote:
>
>  Does this explain it Dave?
>

but that doesn't work either; the problem is that $@ gets unlocalized after
eval assigns to it, even when the argument to die has nothing to do with $@.


    perl -le 'eval { local $@; die "yabbazabba" }; print $@||"nothing there"'

So including an attempt at pass-by-copy in the documentation of what
doesn't work (1) indicates that thinking it might be a pass-by-copy problem
is reasonable and (2) documents by example quoting as a method to force
pass-by-copy.

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