Skip Menu |
 

This queue is for tickets about the Text-CSV CPAN distribution.

Report information
The Basics
Id: 94400
Status: open
Priority: 0/
Queue: Text-CSV

People
Owner: Nobody in particular
Requestors: otto.makela [...] csc.fi
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Feature request
Date: Thu, 03 Apr 2014 14:32:29 +0300
To: bug-Text-CSV [...] rt.cpan.org
From: "Otto J. Makela" <otto.makela [...] csc.fi>
Download (untitled) / with headers
text/plain 331b
Not a bug per se, but a feature request: add function parse_hr() which would decompose a CSV string into a hashref as set by column_names(), in a similar way as getline_hr() does. -- Otto J. Makela CSC - Tieteen tietotekniikan keskus (IT Center for Science) PO Box 405/Keilaranta 14, FI-02101 Espoo, Finland tel. +358 40 7655772
Download (untitled) / with headers
text/plain 333b
On Thu Apr 03 07:32:46 2014, otto.makela@csc.fi wrote: Show quoted text
> Not a bug per se, but a feature request: add function parse_hr () which > would decompose a CSV string into a hashref as set by column_names (), > in a similar way as getline_hr () does.
Is using ScalarIO an option? open my $fh, "<", \$data my $r = $csv->getline_hr ($fh);
Subject: Re: [rt.cpan.org #94400] Feature request
Date: Tue, 14 Oct 2014 12:31:25 +0300
To: bug-Text-CSV [...] rt.cpan.org
From: "Otto J. Makela" <otto.makela [...] csc.fi>
Download (untitled) / with headers
text/plain 574b
On 2014-10-08 10:19, H.Merijn Brand via RT wrote: Show quoted text
> Is using ScalarIO an option? > > open my $fh, "<", \$data > my $r = $csv->getline_hr ($fh);
Obviously this would work, but one would think that it would be natural to have parsing as a function and then build getline_hr to use it. I actually ended up using a hash slice, something like: $csv->parse($data); my %r; @r{ @column_names } = ($csv->fields); -- Otto J. Makela CSC - Tieteen tietotekniikan keskus (IT Center for Science) PO Box 405/Keilaranta 14, FI-02101 Espoo, Finland tel. +358 40 7655772


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.