Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: What is the scope of $_?

by moritz (Cardinal)
on Nov 26, 2012 at 16:10 UTC ( #1005703=note: print w/ replies, xml ) Need Help??


in reply to What is the scope of $_?

To make things even more interesting, given creates a new lexical $_:

$ perl -wE '$_ = 1; sub p { say }; given (42) { say; p }' 42 1


Comment on Re: What is the scope of $_?
Download Code
Replies are listed 'Best First'.
Re^2: What is the scope of $_?
by Tanktalus (Canon) on Nov 26, 2012 at 17:53 UTC

    Interesting? More like buggy :-) Let's hope this gets fixed and given starts to become a bit more safe :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (15)
As of 2015-07-30 16:45 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 (273 votes), past polls