in reply to Merging two hashes, keeping keys unique but adding values if necessary

If I understand your problem correctly (adding values of "same" keys) , your map ² works as expected!

DB<107> \%result => { key1 => 2, key140 => 1, key15 => 4, key150 => 1 }

If you still believe its wrong please show working code¹ and point out whats missing.

Cheers Rolf

(addicted to the Perl Programming Language)

¹) there is at least one = missing

²) Well this (keys %muthash,keys %copyhash) will produce overhead cause it's not a unique list, anyway map still works.)