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");
|
|---|