Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Non-blocking read

by wog (Curate)
on Nov 12, 2001 at 23:11 UTC ( #124892=note: print w/replies, xml ) Need Help??


in reply to Non-blocking read

Probably the easiest, and most portable (since, apparently, Windows perl only supports select for sockets, not to mention that it probably doesn't support termios.), way to do this would be to use Term::ReadKey:

use Term::ReadKey; for (;;) { if (defined(my $c = ReadKey(-1))) { # got a character $c, process } # do other stuff }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://124892]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2022-11-26 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?