Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-07-07 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls