Firstly, what a great module, thanks! I've always found it reliable and effective.

It would be handy if string() returned the string read by getline().

Although this does seem to work...

use Text::CSV_XS; use IO::File; # tell/seek fails if i omit this line my $file = "1,2,3\n4,5,6\n7,8,9\n10,11,12\n13,14,15"; open (my $io, '<', \$file); # Open filehandle to in memory file my $csv = Text::CSV_XS->new(); while (1) { my $start = tell($io); my $colref = $csv->getline($io); last unless $colref; print "Array: @$colref\n"; my $length = tell($io) - $start; seek($io, $start, 0); read($io, my $string, $length); print "String: <$string>\n"; }

What do you think? Would it be possible for Text::CSV_XS to return the string more efficiently?

I've also wondered whether eol would always be limited to a finite set of predefined strings?

Thanks again.

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

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, 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, 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.