Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: easy way to extract a hash from an array?

by nobull (Friar)
on Feb 08, 2006 at 18:20 UTC ( #528889=note: print w/replies, xml ) Need Help??


in reply to easy way to extract a hash from an array?

If you are doing a lot of such lookups then you may find it worthwhile to index @PEOPLE.
my %PEOPLE_index; for my $ppl (@PEOPLE) { while ( my ( $k,$v) = each %$ppl ) { push @{$PEOPLE_index{$k}{$v}} => $ppl; } } for my $ppl ( @{$PEOPLE_index{fname}{John}} ) { #.... }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2021-04-14 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?