Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Checing presence of input on standard input in non-blocking way, sans user interaction

by wet (Initiate)
on May 25, 2015 at 07:00 UTC ( [id://1127653]=note: print w/replies, xml ) Need Help??


in reply to Re: Checing presence of input on standard input in non-blocking way, sans user interaction
in thread Checing presence of input on standard input in non-blocking way, sans user interaction

in my haste - forgot to add, you need to do this before the call to getcmd(). this is from the standard Fcntl package and the sets the file handle to non blocking by adding to the flags, you can reset the flag afterwards.
fcntl(STDIN, F_GETFL, $flg) or die("Couldn't get flags for HANDLE : $!\n"); fcntl(STDIN, F_SETFL, ($flg | O_NONBLOCK)) or die("Couldn't set flags for HANDLE: $!\n");
  • Comment on Re^2: Checing presence of input on standard input in non-blocking way, sans user interaction
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found