in reply to merging two hashes and updating the 1st hash keys.

where as the 2nd way shown here will put the 2nd hash sets unique keys also into the 1st hash.

use the 2nd way, your example shows that is what you want.

  • Comment on Re: merging two hashes and updating the 1st hash keys.

Replies are listed 'Best First'.
Re^2: merging two hashes and updating the 1st hash keys.
by sathiya.sw (Monk) on Aug 28, 2009 at 06:59 UTC
    If am not clear already !

    ---> The first way seems promising as i have the requirement of only the first hash keys remain as it is, where as the 2nd way shown here will put the 2nd hash sets unique keys also into the 1st hash.

    I wanted something like the first way, because i would want the first hash keys remain as it is... I don't want the second hash's unique keys to be added to the 1st hash. But the result i want is like the 1st way i shown, but not as with the same kind of looping implementation.
    Sathiyamoorthy