programming-examples/perl/SystemFunction/ReadMode('cbreak'.pl
2019-11-15 12:59:38 +01:00

11 lines
203 B
Perl

use Term::ReadKey;
ReadMode('cbreak');
if (defined ($char = ReadKey(-1)) ) {
print "This key was waiting: $char.";
} else {
print "Sorry, no key was waiting.";
}
ReadMode('normal');