News from the trenches: a new attribute strict_eol will be available in the next release:


strict_eol

my $csv = Text::CSV_XS->new ({ strict_eol => 1 }); $csv->strict_eol (0); my $f = $csv->strict_eol;

If this attribute is set to 0, no EOL consistency checks are done.

If this attribute is set to 1, any row that parses with a EOL other than the EOL from the first row will cause a warning.
The error will be ignored and parsing continues. This warning is only thrown once. Note that in data with various different
line endings, \r\r will still throw an error that cannot be ignored.

If this attribute is set to 2 or higher, any row that parses with a EOL other than the EOL from the first row will cause
error 2016 to be thrown. The line being parsed to this error might not be stored in the result.


Any feedback welcome ...


The function (method) csv () will use the warning level by default.

There are still some edge-cases that might need a change, but the basics have settled.

Als always, you can get a pre-release from github.

1,A,Ape\r\n 2,B,Bear\r\n 3,C,Canary\n <-- will warn with error 2016

Edge case example:

1,A,Ape\r\n 2,B,Bear\r\n 3,C,Canary\r\r\n <-- will warn with error 2016 but also might not ret +urn an empty row

The edge cases could also be considered "wrong" in all previous releases, and when strict_eol is disabled,
the behavior should be as before.

Older highlights since 1.49 ...


Enjoy, Have FUN! H.Merijn

In reply to Re: The future of Text::CSV_XS - TODO by Tux
in thread The future of Text::CSV_XS - TODO by Tux

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.