Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: mapping two arrays into a hash

by OM_Zen (Scribe)
on Feb 26, 2003 at 22:05 UTC ( #238933=note: print w/ replies, xml ) Need Help??


in reply to mapping two arrays into a hash

Hi ,

#This is with map as both arrays are of same length %hashofarray = map { $array1[$_] => $array2[$_] }0..$#array1; #This is a way to use arrays for building hash @hashofarray{@array1} = @array2;


Comment on Re: mapping two arrays into a hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-05 18:35 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 (67 votes), past polls