Skip Menu |

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

Report information
The Basics
Id: 102222
Status: resolved
Priority: 0/
Queue: Text-CSV

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

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



Subject: Reading file with \r-terminated lines leaves IO system in slurp mode
Greetings- In version 1.21 perl v5.14.2, reading a file whose lines are \r-terminated causes subsequent file input operations to be in slurp mode (in other words, to act as if $/=undef). See attached test files. The PP version doesn't have this problem. I realize I'm not using the latest version and apologize if the bug has been fixed. Thanks very much, Nat
Subject: csv_bug.csv
Col1,Col2 val1,val2
Subject: csv_bug.pl
use strict; use Text::CSV; open(IN,'csv_bug.csv') || die "Cannot open csv_bug.csv: $!"; my $csv=new Text::CSV; while (my $line=$csv->getline(*IN)) { print join("\t",@$line),"\n"; } close IN; open(IN,'csv_bug.txt') || die "Cannot open csv_bug.txt: $!"; while (my $line=<IN>) { print ">>> $line"; } close IN;
Subject: csv_bug.txt
First line of text file Second line of text file
On Fri Feb 20 08:25:30 2015, NATG wrote: Show quoted text
> Greetings- In version 1.21 perl v5.14.2, reading a file whose lines > are \r-terminated causes subsequent file input operations to be in > slurp mode (in other words, to act as if $/=undef). See attached test > files. > > The PP version doesn't have this problem. > > I realize I'm not using the latest version and apologize if the bug > has been fixed. > > Thanks very much, > Nat
It appears this issue has been fixed already. If you really think we still need to fix this, try the latest versions of Text::CSV/Text::CSV_XS before you reopen this issue.