Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: problem with array of hashes

by moritz (Cardinal)
on Oct 09, 2012 at 11:09 UTC ( #997980=note: print w/replies, xml ) Need Help??

in reply to problem with array of hashes

Hash keys aren't ordered, so there is no getting of the "last" hash key or so.

So the question is, how do you identify which hash key you want to retrieve? If it's the key with 't' as a value, you have to iterate through the whole hash -- which likely means that the data structure is poorly chosen for you application. Also if you want to search by value, what do you do if multiple keys have the same value?

Or is there any other logic by which you identify the '41'?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2018-06-18 02:27 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (107 votes). Check out past polls.