cyphy has asked for the wisdom of the Perl Monks concerning the following question:
I want to create a function, which returns 'simpsons', when I do:%families= ( flintstones => { father => "fred", mother => "willma", kid => "bambam", }, simpsons => { father => "homer", mother => "marge", kid => "bart", }, }
I also want it to return an error or die, if it can't be found.get_kid($families,"bart"); # should return simpsons
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding something in hashes of hashes
by bobf (Monsignor) on Dec 28, 2009 at 00:52 UTC | |
|
Re: Finding hashes in hashes of hashes
by ahmad (Hermit) on Dec 28, 2009 at 01:23 UTC | |
by bobf (Monsignor) on Dec 28, 2009 at 01:36 UTC | |
|
Re: Finding hashes in hashes of hashes
by AnomalousMonk (Archbishop) on Dec 28, 2009 at 15:24 UTC | |
by cyphy (Initiate) on Dec 28, 2009 at 17:53 UTC | |
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 |