in reply to Re: Text::CSV_XS and line-endings
in thread Text::CSV_XS and line-endings
I'm trying the simplest test case I could think of, but I can't get your suggestion to work. Here is what I'm trying.
#!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; use Data::Dumper; use IO::File; my $fh = IO::File->new; $fh->open( "<test.csv" ) or die $!; my $c = Text::CSV_XS->new( { binary => 1, csv_eol => "\015" } ); my $d = $c->getline( $fh ); print Dumper( $d );
And test.csv contains:
foo,bar,baz^Mred,green,blue^Mnarf,blatz,quux
(Where ^M's are \r's)
That script results in $d being undef, as reported by Data::Dumper. Running the script on the same data with \n's instead of \r's works fine.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Text::CSV_XS and line-endings
by jZed (Prior) on Mar 17, 2006 at 19:39 UTC | |
by samtregar (Abbot) on Mar 17, 2006 at 21:19 UTC | |
by jZed (Prior) on Mar 19, 2006 at 19:08 UTC | |
by friedo (Prior) on Mar 17, 2006 at 20:16 UTC |