Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by Tux (Monsignor)
on May 30, 2007 at 22:55 UTC ( #618349=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: The future of Text::CSV_XS - TODO
Select or Download Code
Re^4: The future of Text::CSV_XS - TODO
by tfrayner (Curate) on May 31, 2007 at 09:32 UTC
    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
        Perfect - that seems to be working fine now. Thanks very much!

        Tim

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (19)
As of 2015-07-02 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (34 votes), past polls