hotshot has asked for the wisdom of the Perl Monks concerning the following question:
If I remember right this function was suggested by another monk, a long time ago when I needed an advice on the matter, and it worked perfectly since than. It seems that the function get stuck on the while loop, as if no key press breaks out of it.use Term::ReadKey; sub pressAnyKey { print "Press any key to continue...\n\n"; ReadMode 4; # turn off control keys While (not defined ($key = ReadKey(-1))) {} readMode 0; # restore read mode }
Title edit by tye/small>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Term::ReadKey
by Thelonius (Priest) on Dec 23, 2003 at 17:45 UTC | |
|
Re: Term::ReadKey
by xenchu (Friar) on Dec 23, 2003 at 22:03 UTC |