Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Creating a hash from arrays

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


in reply to Creating a hash from arrays

You could also use List::MoreUtils, either:

@keys = pairwise {return "$a $b"} @fname, @lname; @hash{@keys} = @state;
or
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
Node Status?
node history
Node Type: note [id://1060981]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2017-11-21 23:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (312 votes). Check out past polls.

    Notices?