- or download this
use strict;
use Data::Dumper;
...
my %h3 = map {$_ => $h1{$_} + $h2{$_}} keys %h1;
print Dumper \%h3;
- or download this
$VAR1 = {
'c' => 3,
'b' => 10,
'a' => 7
};
- or download this
my %h3 = map {$_ => $h1{$_} + $h2{$_}} keys %h1;
- or download this
my %h3 = map {$_ => $h1{$_} + $h2{$_}} keys %h1, keys %h2;