maybe:<br><div style="margin-left:40px">use Hash::Merge qw(merge);<br>%combined_hash = %{ merge( \%combined_hash, \%added_hash ) };<br></div><br>Cheers,<br>Micha<br><br><div class="gmail_quote">On Tue, Oct 30, 2012 at 3:47 PM, Meir Guttman <span dir="ltr">&lt;<a href="mailto:meir@guttman.co.il" target="_blank">meir@guttman.co.il</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thank you Sawyer and Ran. Intriguing… <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">But I was thinking about something akin to how one combines two simple hashes as:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#1f497d">%combined_hash = (%combined_hash, %added_hash);<u></u><u></u></span></b></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">(This of course overwrites same-key records, but in my application this is a “feature” and a bonus... </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">J</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">My problem was that I was lost and couldn’t figure out how to deal with all these references to anonymous inner hashes. </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">L</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Meir<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-left:36.0pt"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:perl-bounces@perl.org.il" target="_blank">perl-bounces@perl.org.il</a> [mailto:<a href="mailto:perl-bounces@perl.org.il" target="_blank">perl-bounces@perl.org.il</a>] <b>On Behalf Of </b>sawyer x<br>
<b>Sent:</b> </span><span dir="RTL" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="HE">יום</span><span dir="LTR"></span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><span dir="LTR"></span> </span><span dir="RTL" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="HE">ב</span><span dir="LTR"></span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><span dir="LTR"></span> 29 </span><span dir="RTL" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="HE">אוקטובר</span><span dir="LTR"></span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><span dir="LTR"></span> 2012 21:07<br>
<b>To:</b> Perl in Israel<br><b>Subject:</b> Re: [Israel.pm] Importing values from a 2D hash into another 2D hash<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p>
<div><p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt">Booya!<u></u><u></u></p><div><p class="MsoNormal" style="margin-left:36.0pt">On Mon, Oct 29, 2012 at 9:04 PM, Ran Eilam &lt;<a href="mailto:ran.eilam@gmail.com" target="_blank">ran.eilam@gmail.com</a>&gt; wrote:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">Returning a new value instead of mutating the sub arguments:<br><br>sub combine_values {<br>  my $old = shift;<br>  my $new  = shift;<br>  return map {$_ =&gt; {<br>      %{ $old-&gt;{$_} },<br>
      %{ $new-&gt;{$_} || {} }<br>  }} keys %$old;<br>}<br><span style="color:#888888"><br><span>Ran</span></span><u></u><u></u></p><div><div><p class="MsoNormal" style="margin-left:36.0pt">_______________________________________________<br>
Perl mailing list<br><a href="mailto:Perl@perl.org.il" target="_blank">Perl@perl.org.il</a><br><a href="http://mail.perl.org.il/mailman/listinfo/perl" target="_blank">http://mail.perl.org.il/mailman/listinfo/perl</a><u></u><u></u></p>
</div></div></div><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p></div></div></div></div></div><br>_______________________________________________<br>
Perl mailing list<br>
<a href="mailto:Perl@perl.org.il">Perl@perl.org.il</a><br>
<a href="http://mail.perl.org.il/mailman/listinfo/perl" target="_blank">http://mail.perl.org.il/mailman/listinfo/perl</a><br></blockquote></div><br>