fdegir has asked for the wisdom of the Perl Monks concerning the following question:
my @childs; for ( my $count = 1; $count <= 4; $count++) { my $pid = fork(); if ($pid) { push(@childs, $pid); }elsif($pid == 0){ testExec($count); exit 0; }else{ die "couldnt fork: $!\n"; } } foreach (@childs) { my $tmp = waitpid($_, 0); print "done with pid $tmp\n"; } ######################## sub testExec($){ my $arg = shift; system("execB $arg"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dying child processes
by ikegami (Patriarch) on Mar 14, 2011 at 18:38 UTC | |
|
Re: Dying child processes
by GrandFather (Saint) on Mar 14, 2011 at 20:07 UTC | |
|
Re: Dying child processes
by Illuminatus (Curate) on Mar 14, 2011 at 19:43 UTC |