Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Perl-ish way to create hash from array

by moritz (Cardinal)
on Jul 09, 2013 at 17:29 UTC ( #1043358=note: print w/replies, xml ) Need Help??


in reply to Perl-ish way to create hash from array

Maybe you want to use a hash slice slice:
my %csvColumns; @csvColumns{@csvColumns} = (0..$#csvColumns);

Or you can the combination of $csvParser->column_names(@csvColumns) and $csvParser->getline_hr to obtain a hash ref from the Text::CSV module directly.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2016-08-31 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (426 votes). Check out past polls.