Skip Menu |

This queue is for tickets about the Text-CSV_XS CPAN distribution.

Report information
The Basics
Id: 61525
Status: resolved
Priority: 0/
Queue: Text-CSV_XS

People
Owner: Nobody in particular
Requestors: IKEGAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.80



Subject: eol not working for values other than "\n"?
Am I missing something? I don't see why I'm getting an error. Show quoted text
------ BEGIN CODE ------ use strict; use warnings; use Text::CSV_XS qw( ); print "$Text::CSV_XS::VERSION\n"; for my $eol ("\n", "!") { print("--\n"); my $csv = Text::CSV_XS->new({ binary => 1, sep_char => ":", eol => $eol, }); my $file = join($eol, qw( "a":"b" "c":"d" )); open(my $fh, '<', \$file) or die; while (my $pair = $csv->getline($fh)) { print("@$pair\n"); } $csv->eof() or die("parse error: " . $csv->error_diag()); }
------ END CODE ------
------ BEGIN OUTPUT ------ 0.73 -- a b c d -- parse error: EIQ - QUO character not allowed at b.pl line 25, <$fh> line 1.
------ END OUTPUT ------
Subject: Re: [rt.cpan.org #61525] eol not working for values other than "\n"?
Date: Thu, 23 Sep 2010 08:27:36 +0200
To: bug-Text-CSV_XS [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Tue, 21 Sep 2010 14:24:58 -0400, "ikegami via RT" <bug-Text-CSV_XS@rt.cpan.org> wrote: Show quoted text
> Am I missing something? I don't see why I'm getting an error.
I do. eol support has never been implemented as they should have been. All `weird' eol's have been broken for ages. I now implemented basic support, but I do need to do some final twitches to make it work with differing $/ values. Thanks a lot for this report! -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00, 11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Thanks, fixed in 0.74.
"\r" was broken, and still is. Show quoted text
------ BEGIN CODE ------ use strict; use warnings; use Text::CSV_XS qw( ); print "$Text::CSV_XS::VERSION\n"; for my $eol ("\n", "\r", "!") { print("--\n"); my $csv = Text::CSV_XS->new({ binary => 1, sep_char => ":", eol => $eol, }); my $file = join($eol, qw( "a":"b" "c":"d" )); open(my $fh, '<', \$file) or die; while (my $pair = $csv->getline($fh)) { print("@$pair\n"); } $csv->eof() or die("parse error: " . $csv->error_diag()); }
------ END CODE ------
------ BEGIN OUTPUT ------ 0.73 -- a b c d -- a b -- parse error: EIQ - QUO character not allowed at a.pl line 25, <$fh> line 1.
------ END OUTPUT ------
------ BEGIN OUTPUT ------ 0.74 @ 899ea5b7ad59f32a51acac9c61bea09be6522bea -- a b c d -- a b -- a b c d
------ END OUTPUT ------
Subject: Re: [rt.cpan.org #61525] eol not working for values other than "\n"?
Date: Tue, 28 Sep 2010 02:12:26 +0200
To: bug-Text-CSV_XS [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Mon, 27 Sep 2010 18:35:12 -0400, "ikegami via RT" <bug-Text-CSV_XS@rt.cpan.org> wrote: Show quoted text
> Queue: Text-CSV_XS > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=61525 > > > "\r" was broken, and still is.
only partly. You shouldn't set eol on *parsing* for \n, \r, or \r\n These are all special cased to cover M$ and Mac. $ cat rt61525.pl #!/pro/bin/perl use strict; use warnings; use Text::CSV_XS; print "$Text::CSV_XS::VERSION\n"; for my $eol ("\n", "\r", "!") { print "--\n"; my $csv = Text::CSV_XS->new ({ binary => 1, sep_char => ":", #eol => $eol, auto_diag => 1, }); $eol eq "!" and $csv->eol ($eol); my $file = join $eol => qw( "a":"b" "c":"d" ); open my $fh, "<", \$file or die; while (my $pair = $csv->getline ($fh)) { print "@$pair\n"; } } $ perl rt61525.pl 0.74 -- a b c d -- a b c d -- a b c d $ -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00, 11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Fixes for 0.77
When I run your above script, I get the following output: [vk-dev]% perl csvtest.perl 0.79 -- a b c d -- # CSV_XS ERROR: 2023 - EIQ - QUO character not allowed @ pos 8 -- a b c d Seems it does not like "\r" line ending? I'm running on FreeBSD 8.1 with perl 5.10.1
Patched, fix will be in 0.80