eval { local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required alarm 2; # $nread = sysread SOCKET, $buffer, $size; sleep 4; alarm 0; }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out warn "alarm timed out"; } else { warn "success "; } __END__ alarm timed out at - line 11.
In reply to Re: SIGALRM and Win32
by Anonymous Monk
in thread SIGALRM and Win32
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |