Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Creating a hash from arrays

by Eily (Monsignor)
on Nov 02, 2013 at 21:34 UTC ( [id://1060981]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @keys = pairwise {return "$a $b"} @fname, @lname;
    @hash{@keys} = @state;
    
  2. or download this
    my $iter = each_array @fname, @lname, @state;
    while( ($firstName, $lastName, $state) = $iter->() ) 
    { 
       $hash{"$firstName $lastName"} = $state;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-03-19 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found