Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: Berk.Akinci [...] corero.com
Cc:
AdminCc:

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



Subject: Text::CSV blocks unnecessarily on interactive input.
Date: Mon, 1 Dec 2014 22:30:20 +0000
To: "bug-Text-CSV [...] rt.cpan.org" <bug-Text-CSV [...] rt.cpan.org>
From: Berk Akinci <Berk.Akinci [...] corero.com>
I'm using Text::CSV_PP interactively. (Yes, it's a little unexpected...) When used interactively, "getline" method "falls behind" by a line. It takes two lines of input for getline() to return. From then on, everything is behind by a line. I found the problem to be the use of "eof" perl function on the interactive input. It blocks, waiting on the second line! My workaround patch is below. Please consider for inclusion. There are other uses of "eof", but this one has so far been the only one that blocks unexpectedly. It would be even better to give us a method to suppress _AUTO_DETECT_CR. This wouldn't work interactively, anyway. In my case, the attached patch seems sufficient. Thanks, Berk Akinci Version: Text-CSV-1.32 Perl: This is perl 5, version 14, subversion 2 (v5.14.2) built for arm-linux-gnueabi-thread-multi-64int uname -a: Linux x 3.2.40 #66 Wed Aug 6 17:49:48 EDT 2014 armv7l armv7l armv7l GNU/Linux --- cpan/Text-CSV-1.32/lib/Text/CSV_PP.pm 2014-12-01 17:04:32.000000000 -0500 +++ lib/perl/Text/CSV_PP.pm 2014-12-01 17:04:33.000000000 -0500 @@ -741,7 +741,7 @@ sub _return_getline_result { - if ( eof ) { + if ( $_[0]->{_AUTO_DETECT_CR} == 1 && eof ) { $_[0]->{_AUTO_DETECT_CR} = 0; }
On Tue Dec 02 07:31:50 2014, Berk.Akinci@corero.com wrote: Show quoted text
> I'm using Text::CSV_PP interactively. (Yes, it's a little > unexpected...) > > When used interactively, "getline" method "falls behind" by a line. > It takes two lines of input for getline() to return. From then on, > everything is behind by a line. I found the problem to be the use of > "eof" perl function on the interactive input. It blocks, waiting on > the second line! My workaround patch is below. Please consider for > inclusion. > > There are other uses of "eof", but this one has so far been the only > one that blocks unexpectedly. It would be even better to give us a > method to suppress _AUTO_DETECT_CR. This wouldn't work interactively, > anyway. In my case, the attached patch seems sufficient. > > Thanks, > Berk Akinci > > > > Version: Text-CSV-1.32 > Perl: This is perl 5, version 14, subversion 2 (v5.14.2) built for > arm-linux-gnueabi-thread-multi-64int > uname -a: Linux x 3.2.40 #66 Wed Aug 6 17:49:48 EDT 2014 armv7l armv7l > armv7l GNU/Linux > > > > --- cpan/Text-CSV-1.32/lib/Text/CSV_PP.pm 2014-12-01 > 17:04:32.000000000 -0500 > +++ lib/perl/Text/CSV_PP.pm 2014-12-01 17:04:33.000000000 -0500 > @@ -741,7 +741,7 @@ > > sub _return_getline_result { > > - if ( eof ) { > + if ( $_[0]->{_AUTO_DETECT_CR} == 1 && eof ) { > $_[0]->{_AUTO_DETECT_CR} = 0; > } >
Text::CSV_PP has been totally refactored since 1.90_01/1.91, and the internal attribute called _AUTO_DETECT_CR is gone (and so is the CORE::eof() usage). Could you test the latest version and see if it works for you? Thanks.
On Sat Jan 28 16:01:16 2017, ISHIGAKI wrote: Show quoted text
> On Tue Dec 02 07:31:50 2014, Berk.Akinci@corero.com wrote:
> > I'm using Text::CSV_PP interactively. (Yes, it's a little > > unexpected...) > > > > When used interactively, "getline" method "falls behind" by a line. > > It takes two lines of input for getline() to return. From then on, > > everything is behind by a line. I found the problem to be the use of > > "eof" perl function on the interactive input. It blocks, waiting on > > the second line! My workaround patch is below. Please consider for > > inclusion. > > > > There are other uses of "eof", but this one has so far been the only > > one that blocks unexpectedly. It would be even better to give us a > > method to suppress _AUTO_DETECT_CR. This wouldn't work > > interactively, > > anyway. In my case, the attached patch seems sufficient. > > > > Thanks, > > Berk Akinci > > > > > > > > Version: Text-CSV-1.32 > > Perl: This is perl 5, version 14, subversion 2 (v5.14.2) built for > > arm-linux-gnueabi-thread-multi-64int > > uname -a: Linux x 3.2.40 #66 Wed Aug 6 17:49:48 EDT 2014 armv7l > > armv7l > > armv7l GNU/Linux > > > > > > > > --- cpan/Text-CSV-1.32/lib/Text/CSV_PP.pm 2014-12-01 > > 17:04:32.000000000 -0500 > > +++ lib/perl/Text/CSV_PP.pm 2014-12-01 17:04:33.000000000 -0500 > > @@ -741,7 +741,7 @@ > > > > sub _return_getline_result { > > > > - if ( eof ) { > > + if ( $_[0]->{_AUTO_DETECT_CR} == 1 && eof ) { > > $_[0]->{_AUTO_DETECT_CR} = 0; > > } > >
> > Text::CSV_PP has been totally refactored since 1.90_01/1.91, and the > internal attribute called _AUTO_DETECT_CR is gone (and so is the > CORE::eof() usage). Could you test the latest version and see if it > works for you? Thanks.
Closed as this can't be applied anymore. Thanks.