$SIG{ALRM} = sub { die "Timed out"; # Or whatever } foreach $task (@tasks) { alarm 30; $task->do_one_task(); }; alarm 0; $SIG{ALRM} = 'DEFAULT';
In reply to Re: Splitting one large timeout into few smaller ones..
by Roy Johnson
in thread Splitting one large timeout into few smaller ones..
by Eyck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |