Closed eserte closed 8 years ago
Is it possible that it's https://github.com/jonathanstowe/TermReadKey/commit/e515a4538249d7eba50a7cd4898ae50848eda29d ? That was fixing an actual bug BTW.
I think I'd need more context though.
It seems that the call GetTerminalSize(STDOUT);
is failing now. With the following diff the tests work again:
diff --git a/lib/Lab/IO/Interface/Term.pm b/lib/Lab/IO/Interface/Term.pm
index 804298a..57b7a08 100644
--- a/lib/Lab/IO/Interface/Term.pm
+++ b/lib/Lab/IO/Interface/Term.pm
@@ -20,7 +20,7 @@ sub new {
$|++;
# Terminal size
- my @size = GetTerminalSize(STDOUT);
+ my @size = GetTerminalSize(\*STDOUT);
$self->{cols} = $size[0] - 1;
$self->{rows} = $size[1];
Yeah, that would make sense as previously the argument to GetTerminalSize was being ignored (so it was always using STDOUT, and was thus presumably correct in most cases,) whereas using the bareword STDOUT
there probably shouldn't work:
perl -Mstrict -we 'sub foo { my ( $fh ) = @_; print $fh "hshshs"; }; foo(STDOUT)'
Bareword "STDOUT" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
Having looked at it, the normalizeHandle
could actually handle this a bit better, but as long as the typeglob is passed then it'll be fine for the time being.
Thanks for the report!
Problem is that Lab::Measurement currently replaces the default STDOUT handle with it's own degenerate handle. I will soon fix this, so that it just uses the unmodified STDOUT.
This has caused problems before, so unlikely that the problem is with Term::ReadKey.
Sorry for the buzz...
But do avoid passing a bareword handle to the sub routines in Term::ReadKey - either pass the typeglob as above or a "lexical" handle in a variable.
Fixed in master (ccdc40a). Thanks.
My smoker machines started to generate test failures for Lab-Measurement 3.520:
It seems that the failure is caused by newer Term::ReadKey versions (>= 2.34) (FYI: @jonathanstowe). Statistical analysis (negative theta is "bad"):