Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: Problem with while loop inside a foreach loop

by Laurent_R (Prior)
on May 04, 2013 at 11:02 UTC ( #1032028=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Problem with while loop inside a foreach loop
in thread Problem with while loop inside a foreach loop

No they aren't :) They alias just like for/foreach.

I know that they alias the same way. But for some reason, I found that nesting foreach statements with the default $_ variable often seems to lead to confusions between the internal and the external values of $_, while I do not have this problem with nested map statements. But it is also possible that I simply don't do it right with the nesting of foreach statement. I don't do that too often anyway, I usually prefer to use explicit variables when nesting such statements in production code.


Comment on Re^4: Problem with while loop inside a foreach loop

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2015-05-25 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (487 votes), past polls