Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Converting a CSV list to a list of hashrefs naming the fields

by MeowChow (Vicar)
on Jun 27, 2001 at 00:06 UTC ( #91735=note: print w/replies, xml ) Need Help??


in reply to Converting a CSV list to a list of hashrefs naming the fields

Why not simply:
my @keys = qw/name score date comment/; my @game; @{$game[@game]}{@keys} = split /,/ for @scores;
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Replies are listed 'Best First'.
Re: Re: Converting a CSV list to a list of hashrefs naming the fields
by merlyn (Sage) on Jun 27, 2001 at 00:19 UTC
    Yes, that was one of the alternatives, but the idea of doing it as a stream for a possibly larger pipeline suggested the use of a map.

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://91735]
help
Chatterbox?
[Petroza]: yes I'll do that. instead of the url I'll write "link"
[LanX]: darn my pc is restarting for updates

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-10-17 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (233 votes). Check out past polls.

    Notices?