Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
[marto]: Nobody we spoke to in Berlin had a clue who Hasslhoff was
[erix]: heh: The Dutch do one thing very, very well
[LanX]: the sidekick of this blonde playboy model which was saving lives with her red bathing suit ... (what was her name again ...)
[choroba]: Pamela Anderson?
[choroba]: erix: I'm proud to be from a nation that also does one thing well
[LanX]: ah yes! And he called her Kit and she could talk while a light was going from her left to right eye and back...
[erix]: choroba: pretty impressive! :)
LanX imagines which nations would be dominating if the winter olympics were invented in East Asia
[LanX]: Corion: and that's the clue how Germany can dominate Handball tournaments, just continuing the domestic league and forbidding the best players of the world to attend :)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2018-02-23 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (303 votes). Check out past polls.

    Notices?