in reply to Re^15: Merge hashes in specific format
in thread Merge hashes in specific format
(%{$one},%{two}) = ( data => { ( %{ $data{data} }, %{ $one->{data} // {} } ) }, total => do { my %total; for my $href ( $one->{total}, $data{total} ) { $total{$_} += $href->{$_} for keys %{ $href }; } \%total; } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^17: Merge hashes in specific format
by LanX (Saint) on Jan 13, 2019 at 02:13 UTC |