Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: What is happening ?

by tilly (Archbishop)
on Aug 19, 2009 at 06:08 UTC ( #789699=note: print w/replies, xml ) Need Help??

in reply to Re^2:problem using foreach and each with hash ref
in thread problem using foreach and each with hash ref

Yes, executing that loop only called each once. But if after that loop you put a second loop that calls each, then that second loop will get a second pair out of the hash. Or if you try to iterate through with a while/each loop, you'll get every pair except the one already consumed in the for loop.

In other words the hash has been left in a potentially bad state.

Replies are listed 'Best First'.
Re^4: What is happening ?
by vinoth.ree (Monsignor) on Aug 19, 2009 at 06:15 UTC

    OK thanks!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2016-10-22 09:31 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (294 votes). Check out past polls.