in reply to creating multiple instances of a process
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: creating multiple instances of a process
by sweetblood (Prior) on Jun 20, 2005 at 14:04 UTC | |
by Zaxo (Archbishop) on Jun 20, 2005 at 18:32 UTC | |
by sweetblood (Prior) on Jun 20, 2005 at 19:55 UTC |