<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1255">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you Sawyer and Ran. Intriguing… <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>But I was thinking about something akin to how one combines two simple hashes as:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>%combined_hash = (%combined_hash, %added_hash);<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D'>)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Meir<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> perl-bounces@perl.org.il [mailto:perl-bounces@perl.org.il] <b>On Behalf Of </b>sawyer x<br><b>Sent:</b> </span><span lang=HE dir=RTL style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>éåí</span><span dir=LTR></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><span dir=LTR></span>&nbsp;</span><span lang=HE dir=RTL style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>á</span><span dir=LTR></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><span dir=LTR></span> 29 </span><span lang=HE dir=RTL style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>àå÷èåáø</span><span dir=LTR></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><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<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt'>Booya!<o:p></o:p></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:<o:p></o:p></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>&nbsp; my $old = shift;<br>&nbsp; my $new &nbsp;= shift;<br>&nbsp; return map {$_ =&gt; {<br>&nbsp; &nbsp; &nbsp; %{ $old-&gt;{$_} },<br>&nbsp; &nbsp; &nbsp; %{ $new-&gt;{$_} || {} }<br>&nbsp; }} keys %$old;<br>}<br><span style='color:#888888'><br><span class=hoenzb>Ran</span></span><o:p></o:p></p><div><div><p class=MsoNormal style='margin-left:36.0pt'>_______________________________________________<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><o:p></o:p></p></div></div></div><p class=MsoNormal style='margin-left:36.0pt'><o:p>&nbsp;</o:p></p></div></div></body></html>