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