perlquestion
tomazos
<strong>How do you perform a non-blocking read from standard input?</strong>
<p>
I want to write an interactive script that I am going to run from a command-line.
<p>
I want it to do things and read input keystrokes that may be present at the same time.
<p>
To do this, I believe the best way would be to setup a tight loop that alternated between testing if there are any characters on the input and going on with it's tasks at the same time.
<p>
In order to do that I would need a call (similar to the flock non-blocking flag) that would tell me if new input is present yet and return immediately if it is not.
<p>
Any ideas?