in reply to Re^7: Merge hashes in specific format
in thread Merge hashes in specific format
Is it impossible to somehow ignore that warning? In other words, make it copy $data{total} for the first iteration?my ($name,$dirs,$final_href) = @_; my %data; foreach my $dir (@{$dirs}) { decode($dir."/".$name,%data); # will change name my $final_href = ( data => { ( %{$final_href->{data} },%{ $data{data} } ) }, total => do { my %total; for my $href ( $final_href->{total}, $data{total} ) { $total{$_} += $href->{total}{$_} for keys %{ $href +->{total} }; } \%total; } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Merge hashes in specific format
by LanX (Saint) on Jan 12, 2019 at 23:27 UTC | |
by ovedpo15 (Pilgrim) on Jan 12, 2019 at 23:30 UTC | |
by tybalt89 (Monsignor) on Jan 13, 2019 at 00:11 UTC | |
by ovedpo15 (Pilgrim) on Jan 13, 2019 at 00:33 UTC | |
by tybalt89 (Monsignor) on Jan 13, 2019 at 00:41 UTC | |
| |
by pryrt (Abbot) on Jan 13, 2019 at 00:44 UTC | |
| |
by LanX (Saint) on Jan 12, 2019 at 23:36 UTC |