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 ) );