in reply to Stopping code in eval
The link includes the following code (to wet your appetite), but don't just read it and mis out on the discussion. Follow the link, where the code is even chromacoded.
Update: Added ", 3rd Ed."eval { local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required alarm $timeout; $nread = sysread SOCKET, $buffer, $size; alarm 0; }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out } else { # didn't }
|
|---|