(code updated)use POSIX ":sys_wait_h"; my $child = fork; if ($child) { # parent case my $res; while (not ($res = waitpid($child, WNOHANG))) { sleep 5; # check file list here # ... } if ($res == -1) { warn "fatal child error\n"; exit; } } else { # child case # insert job processing here exit; # child must explicitly exit otherwise both would continue e +xecuting this } # reach here if job processing completed successfully
One world, one people
In reply to Re: Doing every X seconds
by anonymized user 468275
in thread Doing every X seconds
by dideod.yang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |