Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Re: sleep doesn't respond to sigint(2)?by JamesNC (Chaplain) |
on Oct 18, 2003 at 13:40 UTC ( [id://300279]=note: print w/replies, xml ) | Need Help?? |
Alarm works on Win32, but not ALL the time such as when you do a blocking system calls like $response = <stdin> Abigail explains why this is so. Here is a sub that I wrote that will get you around the <stdin> problem that uses Term::ReadKey. If you don't supply a sub handler... it will just use a default... this is pretty useful for getting input from the keyboard when you want to timeout... play with it... you will get the idea..
Update: missing code added :-) Update2: added code to handle backspaces JamesNC
In Section
Seekers of Perl Wisdom
|
|