Skip Menu |

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

Report information
The Basics
Id: 71383
Status: rejected
Priority: 0/
Queue: Text-CSV

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

Bug Information
Severity: (no value)
Broken in: 1.21
Fixed in: (no value)



Subject: PP behavior is different from XS when getline broken CSV
The attached script uses 1 getline($fh) for broken CSV string and then print position of $fh and size of CSV string size. result of PP: 49 212 result of XS: 212 212 If the column like 'aaaa"' exists, PP seems to parse CSV from the point to end of file. Text::CSV version is 1.21 Text::CSV_XS version is 0.85
Subject: csv.pl
use Text::CSV; use strict; my $data = join "", <DATA>; open my $fh, '<', \$data; my $csv = Text::CSV->new({eol => "\n"}); my $col = $csv->getline($fh); print join "\t", tell $fh, length($data); __END__ hhhhhh","iiiiiiiiiiiiiiiiiiiii","jjjjjjjjjjjjjj" "eeeee","fffffffffff","ggggggggg" "llllllllllllllllllllllllllll","mmmmm","n" "llllllllllllllllllllllllllll","mmmmm","n" "llllllllllllllllllllllllllll","mmmmm","n"
Sorry result is reversed. result of XS: 49 212 result of PP: 212 212 On 2011-10月-01 土 11:12:21, KTAT wrote: Show quoted text
> The attached script uses 1 getline($fh) for broken CSV string and then > print position of $fh and size of CSV string size. > > result of PP: 49 212 > result of XS: 212 212 > > If the column like 'aaaa"' exists, PP seems to parse CSV from the
point to Show quoted text
> end of file. > > Text::CSV version is 1.21 > Text::CSV_XS version is 0.85
Since PP uses regexp for parse, the result is different from XS (parsing each chars). Sorry for my lazy response. On 2011-10月-01 土 11:12:21, KTAT wrote: Show quoted text
> The attached script uses 1 getline($fh) for broken CSV string and then > print position of $fh and size of CSV string size. > > result of PP: 49 212 > result of XS: 212 212 > > If the column like 'aaaa"' exists, PP seems to parse CSV from the point to > end of file. > > Text::CSV version is 1.21 > Text::CSV_XS version is 0.85