in reply to Problem with timeout
You might have more luck if you use http://search.cpan.org/~rgarcia/Perl-Unsafe-Signals-0.02/Signals.pm to allow unsafe signals around you gets.