You need to put the terminal in raw mode. Try it like this:
use Term::ReadKey; while(1) { ReadMode(4); # Set raw mode. while(not defined($firstkey=ReadKey(-1))) { print localtime(); print "\n"; } ReadMode(0); # Restore original mode. chomp($a=<STDIN>); if($a eq 'q') { exit; } }
-sauoq "My two cents aren't worth a dime.";
In reply to Re: While loop insanity
by sauoq
in thread While loop insanity
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |