Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Just another Perl shrine
 
PerlMonks  

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

by Laurent_R (Priest)
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 cooling their heels in the Monastery: (5)
As of 2014-04-20 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls