[Israel.pm] Importing values from a 2D hash into another 2D hash
sawyer x
xsawyerx at gmail.com
Mon Oct 29 12:06:59 PDT 2012
Booya!
On Mon, Oct 29, 2012 at 9:04 PM, Ran Eilam <ran.eilam at gmail.com> wrote:
> 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
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20121029/292bb714/attachment-0001.htm
More information about the Perl
mailing list