sub merge_hashes { my ($x, $y) = @_; foreach my $k (keys %$y) { if (!defined($x->{$k})) { $x->{$k} = $y->{$k}; } else { $x->{$k} = merge_hashes($x->{$k}, $y->{$k}); } } return $x; }
In reply to Re: Merge hash into another hash
by eamallove
in thread Merge hash into another hash
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |