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

Re: local $@ has an unwanted side effect

Thread Previous | Thread Next
David Nicol
March 21, 2008 16:19
Re: local $@ has an unwanted side effect
Message ID:
On Fri, Mar 21, 2008 at 6:13 PM, Mark Mielke <> 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

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