Subject: | Deal with non-seekable IO |
Programs that use an emulated IO class are now required to implement tell/seek/read. In Text-CSV_XS-0.88 it was enough to implement getline(). Could you make Text-CSV_XS deal with this kind of simplified IO classes?
With Text-CSV_XS-0.90 this program dies with:
-----------------------------------------------------------
With Text-CSV_XS-0.90 this program dies with:
0.90
Can't locate object method "tell" via package "MyIO" at demo line 17.
-----------------------------------------------------------
BEGIN {
package MyIO;
sub new { return bless { c => 3 }, shift }
sub getline {
my $self = shift;
return undef if $self->{c} == 0;
return join(",", 1 .. $self->{c}--) . "\n";
}
}
use Text::CSV_XS ();
print $Text::CSV_XS::VERSION, "\n";
my $io = MyIO->new;
my $csv = Text::CSV_XS->new;
while (my $row = $csv->getline($io)) {
use Data::Dump; dd $row;
}