This works on Linux and should work on other UNIX-like OSs as well. It won't work on Windows (both ActiveState and Cygwin) since select returns the time that was passed in as $timeleft, regardless of how long you've slept.my $timeleft = 10000; while ($timeleft){ $timeleft = (select(undef,undef,undef,$timeleft))[1]; }
Hope this helps.
In reply to Re: select and %SIG
by bschmer
in thread select and %SIG
by Rhandom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |