In perl is there a way to have a program sleep for a certain amount of time unless the user presses a key? The following is my code:
use Term::ReadKey;
ReadMode 4;
while (not defined ($key = ReadKey(-1))) {
sleep(50);
}
print "Get key $key\n";
ReadMode 0;