BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
When I run the following one-liner and press the enter key (or ^M), I get no output for the first 3 presses, and 13 is output for the fourth (and subsequent) press. If I hit an alpha key, two of the 3 missing 13s are displayed before the ord of that alpha key.
perl -MTerm::ReadKey -E"ReadMode 3; say ord ReadKey( 0 ) while 1"
Can anyone a) confirm they see the same behaviour? b) explain it?
The ReadMode can be 3, 4, or 5 without affecting the results--but the latter two require ^Break to terminate the program.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Term::ReadKey(0) and Windows
by kennethk (Abbot) on Sep 16, 2010 at 17:42 UTC | |
|
Re: Term::ReadKey(0) and Windows
by Marshall (Canon) on Sep 16, 2010 at 19:38 UTC | |
|
Re: Term::ReadKey(0) and Windows
by Anonymous Monk on Sep 16, 2010 at 20:57 UTC | |
by BrowserUk (Patriarch) on Sep 16, 2010 at 21:20 UTC |