Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://874192]
help
Chatterbox?
[erix]: ah, Romulus killed Remus. Sad! ;)
erix .oO( does Trump have a brother ? )
[Discipulus]: yes a minor one:
[Discipulus]: Trumpet
Discipulus or is a dog, cat..?

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2017-01-20 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.