Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Unexpected result after localizing eval_error variable "$@" within "BEGIN" block

by demerphq (Chancellor)
on Dec 26, 2007 at 17:57 UTC ( #659089=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Unexpected result after localizing eval_error variable "$@" within "BEGIN" block
in thread Unexpected result after localizing eval_error variable "$@" within "BEGIN" block

The question is whether the first example you posted is sane. I personally dont think it is. Thats not to say that im right, but id like to hear a cogent explanation of why im wrong before I change my mind. IOW, it seems to me that localizing $@ should affect only evals called from within the block. Once the block ends (either through run-to-bottom or through a fatal error) the localization should end and the value of the failed eval should be avalable in the outer context.

In short, I consider the behaviour of the first example you posted to be inconsistant with both the general understanding of localization and my understanding of how localization works internally. In short I suspect a bug that is more or less the omission of a LEAVE statement.

---
$world=~s/war/peace/g


Comment on Re^3: Unexpected result after localizing eval_error variable "$@" within "BEGIN" block

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://659089]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-07-31 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls