Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Perl-ish way to create hash from array

by kennethk (Abbot)
on Jul 09, 2013 at 17:30 UTC ( #1043360=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %csvColumns = map {$csvColumns[$_] => $_} 0 .. $#csvColumns;
    
  2. or download this
    my %csvColumns = do {my $i = 0; map {$_ => $i++} @csvColumns};
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043360]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2017-05-23 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?