<?xml version="1.0" encoding="windows-1252"?>
<node id="617577" title="The future of Text::CSV_XS - TODO" created="2007-05-25 15:06:27" updated="2007-05-25 11:06:27">
<type id="120">
perlmeditation</type>
<author id="200365">
Tux</author>
<data>
<field name="doctext">
&lt;p&gt;This is a follow-up on [614039|my previous post] on [mod://Text::CSV_XS]&lt;/p&gt;

&lt;p&gt;I have been digging a bit to find what people consider loose ends in [mod://Text::CSV_XS], and tried to summarize that (in no particular order) in the new TODO list. Here &lt;i&gt;TODO&lt;/i&gt; gives no guarantee that it will be done, nor on any implementation or API that it might suggest, it is there now just so I/we do not forget to think about these issues.&lt;/p&gt;

&lt;p&gt;I'd like to get thoughts/feedback/suggestions about items on this list, and how valuable you consider adding these features to a modules so heavily used by other applications.&lt;/p&gt;

&lt;p&gt;[jZed] asked me to also post to this to the dbi-users list, cause many DBI users (have to) deal with CSV data, which I already did. So start shooting ...&lt;/p&gt;

&lt;font size="-2"&gt;
&lt;h4&gt;TODO (updated to 0.80 on 25-12-2010)&lt;/h4&gt;
&lt;dl&gt;
 &lt;dt&gt;&lt;strong&gt;&lt;a name="more_errors_warnings" class="item"&gt;More Errors &amp;amp; Warnings&lt;/a&gt;&lt;/strong&gt;
 &lt;dd&gt;
  &lt;p&gt;New extensions ought to be clear and concise in reporting what error
   occurred where and why, and possibly also tell a remedy to the problem.
   error_diag is a (very) good start, but there is more work to be done here.&lt;/p&gt;
  &lt;/dd&gt;
 &lt;dd&gt;
  &lt;p&gt;Basic calls should croak or warn on illegal parameters. Errors should be
   documented.&lt;/p&gt;
  &lt;/dd&gt;

 &lt;dt&gt;&lt;strong&gt;&lt;a name="setting_meta_info" class="item"&gt;setting meta info&lt;/a&gt;&lt;/strong&gt;
 &lt;dd&gt;
  &lt;p&gt;Future extensions might include extending the &lt;c&gt;meta_info ()&lt;/c&gt;,
   &lt;c&gt;is_quoted ()&lt;/c&gt;, and &lt;c&gt;is_binary ()&lt;/c&gt; to accept setting these
   flags for fields, so you can specify which fields are quoted in the
   &lt;c&gt;combine ()&lt;/c&gt;/&lt;c&gt;string ()&lt;/c&gt; combination.&lt;/p&gt;
  &lt;/dd&gt;
 &lt;dd&gt;
  &lt;pre&gt;
  $csv-&amp;gt;meta_info (0, 1, 1, 3, 0, 0);
  $csv-&amp;gt;is_quoted (3, 1);&lt;/pre&gt;
  &lt;/dd&gt;

 &lt;dt&gt;&lt;strong&gt;&lt;a name="combined_methods" class="item"&gt;combined methods&lt;/a&gt;&lt;/strong&gt;
 &lt;dd&gt;
  &lt;p&gt;Requests for adding means (methods) that combine &lt;c&gt;combine ()&lt;/c&gt; and
   &lt;c&gt;string ()&lt;/c&gt; in a single call will &lt;strong&gt;not&lt;/strong&gt; be honored. Likewise for
   &lt;c&gt;parse ()&lt;/c&gt; and &lt;c&gt;fields ()&lt;/c&gt;. Given the trouble with embedded newlines,
   Using &lt;c&gt;getline ()&lt;/c&gt; and &lt;c&gt;print ()&lt;/c&gt; instead is the preferred way to go.&lt;/p&gt;
  &lt;/dd&gt;

 &lt;dt&gt;&lt;strong&gt;&lt;a name="parse_the_whole_file_at_once" class="item"&gt;Parse the whole file at once&lt;/a&gt;&lt;/strong&gt;
 &lt;dd&gt;
  &lt;p&gt;Implement new methods that enable parsing of a complete file at once,
   returning a list of hashes. Possible extension to this could be to
   enable a column selection on the call:&lt;/p&gt;
  &lt;pre&gt;
   my @AoH = $csv-&gt;parse_file ($filename, { cols =&gt; [ 1, 4..8, 12 ]});&lt;/pre&gt;
  &lt;p&gt;Returning something like&lt;/p&gt;
  &lt;pre&gt;
   &amp;#x5b; { fields =&amp;gt; &amp;#x5b; 1, 2, &amp;quot;foo&amp;quot;, 4.5, undef, &amp;quot;&amp;quot;, 8 ],
       flags  =&amp;gt; &amp;#x5b; ... ],
       errors =&amp;gt; &amp;#x5b; ... ],
       },
     { fields =&amp;gt; &amp;#x5b; ... ],
       .
       .
       },
     ]&lt;/pre&gt;
  &lt;p&gt;Note that &lt;c&gt;getline_all ()&lt;/c&gt; already returns all rows for an open
   stream, but this will not return flags.&lt;/p&gt;
  &lt;/dd&gt;
 &lt;/dd&gt;

 &lt;dt&gt;&lt;strong&gt;&lt;a name="ebcdic" class="item"&gt;EBCDIC&lt;/a&gt;&lt;/strong&gt;
 &lt;dd&gt;
  &lt;p&gt;The hard-coding of characters and character ranges makes this module
   unusable on EBCDIC system. Using some #ifdef structure could enable
   these again without loosing speed. Testing would be the hard part.&lt;/p&gt;
  &lt;/dd&gt;
 &lt;/dl&gt;
&lt;/font&gt;

&lt;hr /&gt;

&lt;p&gt;The most current state is available on the [http://repo.or.cz/r/Text-CSV_XS.git|public GIT repo].&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-200365"&gt;
&lt;br /&gt;
Enjoy, Have FUN! H.Merijn
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
