in reply to Re: Fork and wait question
in thread Fork and wait question
To spawn a new child process, use:
and after the spawning loop, use:die "unable to fork: $!" unless (defined(my $id = fork()); if ($id == 0) { exec($testpath) or die "unable to exec $testpath: $!\n"; }
to wait for all of your children to terminate.while (wait > -1) {};
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Fork and wait question
by chris68805 (Initiate) on Jun 12, 2008 at 16:51 UTC |