Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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.

Comment on Re^3: What is happening ?
Replies are listed 'Best First'.
Re^4: What is happening ?
by vinoth.ree (Prior) 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 imbibing at the Monastery: (2)
As of 2015-11-27 01:13 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (710 votes), past polls