Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by Laurent_R (Parson)
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 examining the Monastery: (17)
As of 2014-08-29 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls