Just wanted to say thanks. Although it was not my query originally, I found your method worked in the situation I needed, whereas the other methods utilising SIG don't seem to work under ActivePerl on Windows.
Just one tweak: a line before the return to prevent it complaining about uninitialised values:
$string= defined $string ? $string : "No input" ;
Thanks again. :)
In reply to Re^2: Time-limited input on STDIN
by Ackolight
in thread Time-limited input on STDIN
by ajdelore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |