About a year ago there were reports of some RedHat Linux systems
weren't working correctly with Term::ReadKey. Non-blocking ReadKey()
would block, or it would spin its wheels or something. This problem
makes POE::Wheel::ReadLine useless on some systems.
One of POE 0.30's release goals is to resolve the Term::ReadKey issues
in POE::Wheel::ReadLine. Nobody I've spoken to recently can reproduce
the problem.
If you'd like to help, please try this test case and let me know if it
fails.
#!/usr/bin/perl
use Term::ReadKey;
print "Press 'q' to quit this test.\n";
ReadMode 5; # Turns off controls keys
while (1) {
while (not defined ($key = ReadKey(-1))) {
print "Didn't get a key. Sleeping 1 second.\015\012";
sleep (1);
}
print "Got key: $key\015\012";
($key eq 'q') and last;
}
ReadMode 0; # Reset tty mode before exiting
exit;
...
When you type into it, the test should display something like this:
1) poerbook:~/projects/support% perl term-readkey-nonblocking.perl
Press 'q' to quit this test.
Didn't get a key. Sleeping 1 second.
Got key: t
Didn't get a key. Sleeping 1 second.
Got key: e
Got key: s
Got key: t
Didn't get a key. Sleeping 1 second.
Didn't get a key. Sleeping 1 second.
Got key: q
1) poerbook:~/projects/support%
It seems to fail most commonly by not registering keypresses. That
is, you'll see a stream of "Didn't get a key." messages even when you
type into the program. If this happens you may need to kill the
program from another process.
If the test case fails for you, please mail the output of the
following program to [EMAIL PROTECTED] Please use a meaningful
subject, and please include a valid return address if you'd like to
assist further.
#!/usr/bin/perl
use warnings;
use strict;
use Term::ReadKey;
print "----- system -----\n";
system("uname", "-a");
print "----- perl -----\n";
system($^X, "-V");
print "----- stty before -----\n";
system("stty", "-a");
print "----- stty inside -----\n";
ReadMode 5;
system("stty", "-a");
ReadMode 0;
print "----- stty after -----\n";
system("stty", "-a");
print "----- done -----\n";
exit;
Thank you.
--
Rocco Caputo - http://poe.perl.org/