NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Feedback (Score:1)
No contest:
column_names.Definitely no rewinding magic. In fact, I wouldn’t even include a
column_names_from_linesugar method, because all it does is save five keystrokes on a rare operation for the price of concealing how that works. And that’s the only reason users might forget about having to call that method first thing.If you just tell them that they need to set up the column names manually (and here’s an easy way to take them from the first line of the file), then it’s p
Re: (Score:1)
column_names (Score:1)
I agree that column_names is a much better than the other.
column_names gets my vote! (Score:1)
But have you seen the interface that Text::xSV [cpan.org] uses?
Personally I quite like the read_header() function.
Re: Text::xSV (Score:1)
I think because it doesn't have "CSV" in the module name, distribution name or description, it's difficult to find by searching by on CPAN. At least it was for me.
I did not that it is not an "XS" module, so would be slower than Text::CSV_XS.
Re: (Score:1)
http://search.cpan.org/~rsavage/Text-CSV_PP-Iterator-1.00/ [cpan.org]
which also discusses various similar modules.
column_names it is ... (Score:1)
I liked the idea of hr_** for its double meaning: Hash Ref and Header Row, but that might be professional brain deformation from my side.
While I was designing this, I also had DBI in mind, and the obvious next step to try is bind_columns ().
With the new column_names (), it would be nice to do a DBI like bind_keys () so fields are stored in the same scalar over and over again, instead of creating a new scalar on parsing for every field line after line again.
This *could* mean
Enjoy, have FUN! H.Merijn
Tie::Handle::CSV (Score:1)
Done, plus Bind_columns. Go fetch 0.40 (Score:1)
You've now got it, and I also give you bind_columns!
I value feedback, and probably some improvements on the docs, like adding the new stuff to the SYNOPSIS
Enjoy, have FUN! H.Merijn