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

Re: Non-deprecated way to access multi-level hashes

by markov (Scribe)
on Mar 07, 2006 at 15:19 UTC ( #534941=note: print w/ replies, xml ) Need Help??


in reply to Non-deprecated way to access multi-level hashes

use map() to slice:

 my @realnames = map { $_->{realname} } values %names;


Comment on Re: Non-deprecated way to access multi-level hashes
Re^2: Non-deprecated way to access multi-level hashes
by linux454 (Pilgrim) on Mar 07, 2006 at 21:33 UTC
    This is the most efficient solution. I wish I could recall exactly where I have read that maps() are more efficient than foreach. Perhaps in Advanced Perl Programming, or not.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://534941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-11-23 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (132 votes), past polls