<?xml version="1.0" encoding="windows-1252"?>
<node id="1000785" title="Re: CSV Parser, with and without encapsulation" created="2012-10-25 04:14:29" updated="2012-10-25 04:14:29">
<type id="11">
note</type>
<author id="200365">
Tux</author>
<data>
<field name="doctext">
&lt;p&gt;The "best" is of course [mod://Text::CSV_XS] :)&lt;/p&gt;
&lt;p&gt;[mod://Text::CSV] is just a wrapper over [mod://Text::CSV_XS] and/or [mod://Text::CSV_PP].&lt;/p&gt;
&lt;p&gt;If your CSV data is mixed &lt;i&gt;and&lt;/i&gt; invalid, chances are that you might not find a combination of options that will work on &lt;i&gt;all&lt;/i&gt; records, but a good start for what you describe would be something like:&lt;/p&gt;
&lt;code&gt;
my $csv = Text::CSV_XS-&gt;new ({
    binary             =&gt; 1,
    allow_loose_quotes =&gt; 1,
    escape_char        =&gt; undef,
    auto_diag          =&gt; 1,
    });
&lt;/code&gt;
&lt;p&gt;Please carefully read the [http://search.cpan.org/dist/Text-CSV_XS/CSV_XS.pm|manual] for all [http://search.cpan.org/dist/Text-CSV_XS/CSV_XS.pm#new|&lt;c&gt;allow_***&lt;/c&gt;] options.&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>
<field name="root_node">
1000599</field>
<field name="parent_node">
1000599</field>
</data>
</node>
