in reply to Re^2: merge two hashes into one
in thread merge two hashes into one
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: merge two hashes into one
by AnomalousMonk (Archbishop) on May 30, 2018 at 13:59 UTC |