Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Finding hashes in hashes of hashes

by bobf (Monsignor)
on Dec 28, 2009 at 01:36 UTC ( #814566=note: print w/replies, xml ) Need Help??

in reply to Re: Finding hashes in hashes of hashes
in thread Finding hashes in hashes of hashes

That's a step in the right direction, but it fails to test the relationship (called $status in your example) to ensure the match is on the 'kid' key. Your code, as written, will return the surname of the first family tested that contains the name of interest. For example, if the Flintstones' father was also named 'bart' and if that family came first in the foreach loop, the function would return 'flintstones' rather than 'simpsons'.

BTW, the OP did not specify how the code should handle multiple matches (in the event more than one family has a 'kid' named 'bart').

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://814566]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2018-06-22 00:26 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.