Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: The future of Text::CSV_XS - TODO

by tfrayner (Curate)
on May 30, 2007 at 18:51 UTC ( #618266=note: print w/ replies, xml ) Need Help??


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

Thanks very much for looking at this. I've tried 0.27, and it shows the same problem (see my original node, updated, for a test of sorts). I looked through your eol tests, and checked on exactly what was being written out to the temporary file in the \r cases. It appears that in those cases the file is terminated with a \r\n, rather than just \r. I think this may be why your tests pass but mine doesn't?

Cheers,

Tim


Comment on Re^2: The future of Text::CSV_XS - TODO
Re^3: The future of Text::CSV_XS - TODO
by Tux (Monsignor) on May 30, 2007 at 22:55 UTC

    New snapshot just uploaded, in which eol => $/ is permitted for "\r". That extends successful parsing to line endings in the set undef, "\n", "\r\n", and "\r".


    Enjoy, Have FUN! H.Merijn
      Thanks, that's a huge improvement. I'm afraid I've discovered another slight wrinkle, though:
      use strict; use Text::CSV_XS; use IO::File; $/ = "\r"; my $f = IO::File->new_tmpfile; print $f ('a,b,c', $/, '"d","e","f"', $/); seek($f,0,0); my $c = Text::CSV_XS->new({ eol => $/ }); for(0..1){ print join("|",@{ $c->getline($f) })."\n" }
      The first getline works, but the second fails. It looks as though the quote characters are blocking recognition of \r as eol (again, the code here works if $/="\n").

      Cheers,

      Tim

        Thanks for testing further. Above situation fixed, and modified example added to testsuite. snapshot updated.


        Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://618266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-19 04:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls