in reply to Reliable Timeout
# example { # this scope is here just to localize the signal handler local $SIG{ALRM} = sub { die "timeout\n" }; alarm $TIMEOUT; eval { # iffy code 1; } or do { die $@ unless $@ eq "timeout\n"; # propagate other exceptions # handle timeout }; alarm 0; # free alarm }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reliable Timeout
by lidden (Curate) on Feb 14, 2005 at 20:59 UTC | |
by gaal (Parson) on Feb 15, 2005 at 07:30 UTC |