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 pretty much impossible to get confused about it, because, well, you have to set the column names before hashrefs will work, and if you want the names to come from the file, well, you have to take them from the file, and to take them from the file, well, you have to do that right away if they’re on the first line.
So if you include no magic whatsoever, the interface will be clearer, because the correct way of using it will inescapably suggest itself. And it’s not so much typing that it might matter.
Reply to This
Re: (Score:1)