Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

RE: When is a while not a while?

by mikfire (Deacon)
on Aug 24, 2000 at 19:15 UTC ( #29436=note: print w/replies, xml ) Need Help??


in reply to When is a while not a while?

I think you need to explore the wonders of Term::ReadKey, which has lots of neat tricks but one of them is the function ReadKey.

And I quote from perldoc Term::ReadKey ( slightly reformatted to make it read easier )

ReadKey MODE [, Filehandle] Takes an integer argument, which can currently be one of the following values: 0 Perform a normal read using getc -1 Perform a non-blocked read >0 Perform a timed read (If the filehandle is not supplied, it will default to STDIN.) If there is nothing waiting in the buffer during a non-blocked read, then undef will be returned. Note that if the OS does not provide any known mechanism for non-blocking reads, then a `ReadKey -1' can die with a fatal error. This will hopefully not be common.
You can play meaner games with select() if you cannot get this module installed.

mikfire

Replies are listed 'Best First'.
RE: RE: When is a while not a while?
by Miker (Scribe) on Aug 25, 2000 at 00:13 UTC
    Thanks, that did the trick perfectly. No while loop was needed as the key seek was called in one of the main loops of the program. Thank you very very much, mikfire:)
RE: RE: When is a while not a while?
by Miker (Scribe) on Aug 24, 2000 at 22:43 UTC
    Thanks, I'm glad to have as many options as possible. I'm going to know my way around CPAN pretty well after today :) I like the sounds of ReadKey so thats going to be my next try...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2022-10-03 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (15 votes). Check out past polls.

    Notices?