Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: why need my in a foreach loop?

by chromatic (Archbishop)
on Nov 29, 2010 at 06:18 UTC ( #874192=note: print w/ replies, xml ) Need Help??


in reply to Re^2: why need my in a foreach loop?
in thread why need my in a foreach loop?

It is not the "my" that defines the scope of this variable so IMHO it is there only to satisfy "use strict".

I can't think of any other cases in which Perl 5 automatically lexicalizes a named variable without my; I think it's a (useful) consistency.


Comment on Re^3: why need my in a foreach loop?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2014-08-20 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls