http://qs321.pair.com?node_id=531794

jkva has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed Monks.

Let's say I have two hashes :
%hash1 = ( foo => 'bar', baz => { quux => 'qwe', rty => 'uiop', }, perl => ['monks', 'monastery', 'robes'], ) %hash2 = ( wizardry => 'hocus-pocus', foo => 'f00', baz => { grail => 'arthur', }, perl => ['yayy', 'yippee'], hash3 => {key1 => 'value1', key2 => 'value2', }, );

I'd like to "add" %hash2 to %hash1, and existing data should be overwritten while nonexistent data should be added. What would be the best approach to this?

-- jkva