Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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.


Comment on Re: Perl-ish way to create hash from array
Select or Download Code

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 musing on the Monastery: (11)
As of 2014-12-18 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (48 votes), past polls