Perl Term::ReadKey don't wait for newline
- by tim
In a perl script, I'm trying to accept input without blocking and without echoing the characters entered (The script is producing output and I want to have 'hotkeys' to alter its behaviour).
I got as far as using
use Term::ReadKey;
ReadMode( "cbreak", STDIN );
if($input = ReadKey($pause_time, STDIN)){
#process input
}
But once the user types anything then the script stops until a newline is entered. I'd like the input to be processed per-character, without waiting for a newline.