Returning a new value instead of mutating the sub arguments:

sub combine_values {
  my $old = shift;
  my $new  = shift;
  return map {$_ => {
      %{ $old->{$_} },
      %{ $new->{$_} || {} }
  }} keys %$old;
}

Ran
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to