Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://789699]
help
Chatterbox?
and cookies bake in the oven...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-01-18 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (161 votes). Check out past polls.