Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by MeowChow (Vicar)
on Jun 26, 2001 at 20:06 UTC ( [id://91735]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 26, 2001 at 20: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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://91735]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.