my ($i, $return, $pid, @pids); for ($i = 1; $i <= 3; $i++) { if ($pid=fork) { push @pids, $pid; waitpid($pid,0); } elsif (defined $pid) { $return = &my_function($i); print "Returned: $return\n"; exit; } } print "All done.\n";
In reply to RE: RE: Re: Forking and waiting
by slayven
in thread Forking and waiting
by Silas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |