in reply to Re: Merging 2 hashes
in thread Merging 2 hashes - updated again

According to perldoc -f each, you should not add keys to a hash while you are iterating over it in an each loop.

That's true, but the OP wasn't adding keys to the hash. He was modifying values. And that's perfectly save as the iterator iterates over keys, not values.

Abigail

Replies are listed 'Best First'.
Re: Re: Merging 2 hashes
by sauoq (Abbot) on Oct 29, 2003 at 20:29 UTC
    That's true, but the OP wasn't adding keys to the hash.

    And this brings up the question, why was the OP's code failing? Iterating over the inner hash is senseless, but it should work.

    -sauoq
    "My two cents aren't worth a dime.";