my %h1 = qw( a 1 b 2 c 3 ); my %h2 = qw( b 7 c 8 d 4 ); my %h3 = map { $_ => $h1{$_} // 0 + $h2{$_} // 0 } keys %h1, keys %h2;
No warnings, merges both hashes
In reply to Re^3: merge two hashes into one
by Tux
in thread merge two hashes into one
by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |