This queue is for tickets about the TermReadKey CPAN distribution.

Report information
The Basics
Id:
33841
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
michael [...] shoebox.net
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
2.30
Fixed in:
(no value)



Subject: GetTerminalSize() says it takes one filehandle argument, but ignores
The documentation for GetTerminalSize() says it takes one optional argument, a filehandle. When called with one argument it simply ignores the filehandle and attempts to check STDOUT. The offending code in GetTerminalSize() is: my ($file) = normalizehandle( ( @_ > 1 ? $_[1] : \*STDOUT ) ); Which basically means GetTerminalSize() needs to be called with two arguments, the second argument being the filehandle to check. Calling GetTerminalSize(undef, \*STDIN) results in the desired behaviour; it checks STDIN. Either this is a documentation bug, or the code should be: my ($file) = normalizehandle( ( @_ ? $_[0] : \*STDOUT ) );
On Wed Mar 05 22:50:13 2008, MFOWLER wrote:
Show quoted text
> The documentation for GetTerminalSize() says it takes one optional > argument, a filehandle. When called with one argument it simply ignores > the filehandle and attempts to check STDOUT. > > The offending code in GetTerminalSize() is: > > my ($file) = normalizehandle( ( @_ > 1 ? $_[1] : \*STDOUT ) ); > > Which basically means GetTerminalSize() needs to be called with two > arguments, the second argument being the filehandle to check. Calling > GetTerminalSize(undef, \*STDIN) results in the desired behaviour; it > checks STDIN. > > Either this is a documentation bug, or the code should be: > > my ($file) = normalizehandle( ( @_ ? $_[0] : \*STDOUT ) );
That appears to break stuff, I'm inclined to fix the documentation for the next release.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.