Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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
Replies are listed 'Best First'.
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 exploiting the Monastery: (11)
As of 2015-07-08 05:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls