Skip Menu |

This queue is for tickets about the Data-Table CPAN distribution.

Report information
The Basics
Id: 37376
Status: resolved
Priority: 0/
Queue: Data-Table

People
Owner: Nobody in particular
Requestors: rretter [...] san.rr.com
Cc:
AdminCc:

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



Subject: apparent bug: Data::Table::fromTSV() does not accept STDIN as being a file handle
Date: Thu, 03 Jul 2008 16:25:05 -0700
To: bug-Data-Table [...] rt.cpan.org
From: Rob Retter <rretter [...] san.rr.com>
Using perl:

Show quoted text
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 3 registered patches, see perl -V for more detail)

Copyright 1987-2007, Larry Wall

Binary build 1002 [283697] provided by ActiveState http://www.ActiveState.com
Built Jan 10 2008 11:00:53

And the Data-Table package version 1.54.

Invoking Data::Table::fromTSV as follows:

Show quoted text
Data::Table::fromTSV (STDIN, 1, , , , );

It reports an error because it invokes the built-in ref function on the first parameter and fails because the result is empty.  Even if an indirect filehandle is passed as follows:

Show quoted text
my ($indir_fh) = (*STDIN);
Data::Table::fromTSV ($indir_fh, 1, , , , );

the result is still failure.

As far as I know, STDIN is a file handle and the fromTSV function is documented as accepting file handles.


To read from STDIN, use \*STDIN, for example: my $t=Data::Table::fromCSV(\*STDIN, 1); On Thu Jul 03 19:27:28 2008, rretter@san.rr.com wrote: Show quoted text
> Using perl: > > This is perl, v5.10.0 built for MSWin32-x86-multi-thread > (with 3 registered patches, see perl -V for more detail) > > Copyright 1987-2007, Larry Wall > > Binary build 1002 [283697] provided by ActiveState > http://www.ActiveState.com > Built Jan 10 2008 11:00:53 > > > And the Data-Table package version 1.54. > > Invoking Data::Table::fromTSV as follows: > > Data::Table::fromTSV (STDIN, 1, , , , ); > > > It reports an error because it invokes the built-in ref function on > the first > parameter and fails because the result is empty. Even if an indirect > filehandle > is passed as follows: > > my ($indir_fh) = (*STDIN); > Data::Table::fromTSV ($indir_fh, 1, , , , ); > > > the result is still failure. > > As far as I know, STDIN is a file handle and the fromTSV function is > documented > as accepting file handles.
To read from STDIN, use \*STDIN, for example: my $t=Data::Table::fromCSV(\*STDIN, 1); On Thu Jul 03 19:27:28 2008, rretter@san.rr.com wrote: Show quoted text
> Using perl: > > This is perl, v5.10.0 built for MSWin32-x86-multi-thread > (with 3 registered patches, see perl -V for more detail) > > Copyright 1987-2007, Larry Wall > > Binary build 1002 [283697] provided by ActiveState > http://www.ActiveState.com > Built Jan 10 2008 11:00:53 > > > And the Data-Table package version 1.54. > > Invoking Data::Table::fromTSV as follows: > > Data::Table::fromTSV (STDIN, 1, , , , ); > > > It reports an error because it invokes the built-in ref function on > the first > parameter and fails because the result is empty. Even if an indirect > filehandle > is passed as follows: > > my ($indir_fh) = (*STDIN); > Data::Table::fromTSV ($indir_fh, 1, , , , ); > > > the result is still failure. > > As far as I know, STDIN is a file handle and the fromTSV function is > documented > as accepting file handles.