# wait to reap all children for my $pid (@child_pids) { local $SIG{__DIE__}; local $@ = ""; eval { local $SIG{ALRM} = sub { die("alarm\n") }; alarm(3600); # potentially long operation waitpid $pid, 0; alarm(0); 1; } or do { die($@) unless $@ eq "alarm\n"; # timed out warn("Waited too long for child $pid. Skipping it.\n"); } }
In reply to Re^3: wait_all_children for Proc::Fork?
by repellent
in thread wait_all_children for Proc::Fork?
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |