in reply to Combining two hashes

Another way:

@my_hash{keys %my_second_hash} = values %my_second_hash;

The keys from %my_second_hash will clobber any duplicates that are in %my_hash.

Replies are listed 'Best First'.
Re^2: Combining two hashes
by dug (Chaplain) on May 17, 2005 at 23:52 UTC
    My very rudimentary non-conclusive damned lies recommend that the version you showed here is a fair bit faster than either creating the third hash or the %my_hash = ( %my_hash, %my_second_hash ); variant.

    -- Douglas Hunter