in reply to Re: blocking socket and alarm
in thread blocking socket and alarm

It's also much simpler. Why didn't I think of that?

use IO::Select (); sub socket_read { my $sel = IO::Select->new($socket); while (!$sel->can_read(60)) { print STDERR "Received alarm\n"; } my $len = $socket->sysread($line, 1024); ... }

Reference: IO::Select