Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: hashes with multiple values per key

by edan (Curate)
on Jan 24, 2005 at 13:35 UTC ( #424576=note: print w/ replies, xml ) Need Help??


in reply to hashes with multiple values per key

my %hash; for my $i ( 0 .. $#keys ) { $hash{ $keys[$i] } = [ $values1[$i], $values2[$i] ]; } for my $value ( @values3 ) { if ( exists $hash{ $value } ) { print @{ $hash{ $value } }; } }

disclaimer: UNTESTED

--
edan

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (1)
As of 2016-06-30 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (388 votes). Check out past polls.