in reply to Re: Finding hashes in hashes of hashes
in thread Finding hashes in hashes of hashes
but where would I say, it should die, when 'bart' is not found? It has been a while since I used perl the last time. I returned, because I missed the nice community and CPAN. However, since I used some more exotic languages (far away from C-like styles and paradigms) I guess I need to rewire my brain. I hope I remember correctly, how Perls scopes and datatypes work. Maybe I should just try to find my old perl books.get_family_member('bart',$families); sub get_family_member { my @args = @_; my $who = shift @args; my $families = shift @args; foreach my $family (%families) { if ($families->{$family}->{kid} eq "bart") { return $dfamilies->{$family}->{kid}; last; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Finding hashes in hashes of hashes
by bobf (Monsignor) on Dec 28, 2009 at 18:49 UTC | |
by AnomalousMonk (Archbishop) on Dec 28, 2009 at 20:07 UTC | |
by cyphy (Initiate) on Dec 29, 2009 at 14:26 UTC |