<?xml version="1.0" encoding="windows-1252"?>
<node id="814649" title="Re^3: Finding hashes in hashes of hashes" created="2009-12-28 13:49:55" updated="2009-12-28 13:49:55">
<type id="11">
note</type>
<author id="375665">
bobf</author>
<data>
<field name="doctext">
&lt;p&gt;
The 'die' would go after the foreach (refer to the pseudocode that I [id://814562|posted]).  Note the comments below:
&lt;code&gt;
sub get_family_member {
  my @args = @_;
  my $who = shift @args; # &lt;-- this var is not used
  my $families = shift @args;
  foreach my $family (%families) {
    if ($families-&gt;{$family}-&gt;{kid} eq "bart") { # &lt;-- are you sure you want to hard-code 'bart'? I think you need $who
      return $dfamilies-&gt;{$family}-&gt;{kid}; # &lt;-- typo in hash name
      last; # &lt;-- this will never be reached since it already returned
    }
  }

  # no matches found:  die here
}
&lt;/code&gt;
&lt;/p&gt;</field>
<field name="root_node">
814561</field>
<field name="parent_node">
814639</field>
</data>
</node>
