Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: How to make a hash out of two arrays,one with keys and other with values?

by NetWallah (Canon)
on Jun 30, 2009 at 13:27 UTC ( [id://776022]=note: print w/replies, xml ) Need Help??


in reply to Re: How to make a hash out of two arrays,one with keys and other with values?
in thread How to make a hash out of two arrays,one with keys and other with values?

No - that does not work.

You need =>     , not =

. Also, the preferred sigil for array element in perl5 is $.

my %hash=map {$array1[$_]=>$array2[$_]} 0..$#array1;
(Identical to ikegami's posting.)

     Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)

  • Comment on Re^2: How to make a hash out of two arrays,one with keys and other with values?
  • Download Code

Replies are listed 'Best First'.
Re^3: How to make a hash out of two arrays,one with keys and other with values?
by hnd (Scribe) on Jun 30, 2009 at 16:55 UTC
    really sorry.........
    i overlooked it.....

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found