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

Re: local $@ has an unwanted side effect

Thread Previous | Thread Next
Mark Mielke
March 21, 2008 15:37
Re: local $@ has an unwanted side effect
Message ID:
David Nicol wrote:
> On Fri, Mar 21, 2008 at 12:59 PM, Mark Mielke <> wrote:
>>  seem to be something that absolutely must change), I believe the true
>>  problem here is that die seems to be pass by reference, and that local
>>  is restoring the value to undef (or whatever it was before) before $@ is
>>  made available to the caller.
> no that's not it but it is a red herring -- I would like to revise the proposed
> addition of this issue to the eval documentation to but double-quotes
> around the $@ in the commented-out line in the example code.

That's not a real solution - what about if $@ is an object?

Effectively you are changing pass by reference to pass by string copy - 
which is good for probably 95%+ cases. As I said, the problem is pass by 


Mark Mielke <>

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