The wait function will take care of your needs. Here's how I like to organize it,
my %kid; for (0 .. $num) { defined(my $cpid = fork) or warn $! and next; $kid{$cpid} = undef, next if $cpid; # do kid stuff exit 0; } delete $kid{wait()} while %kid;
After Compline,
Zaxo
In reply to Re: creating multiple instances of a process
by Zaxo
in thread creating multiple instances of a process
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |