Parallel::ForkManager looks like a good fit for what you want, it makes it easy to start a number of processes to work through a list.
use Parallel::ForkManager; $pm = Parallel::ForkManager->new($MAX_PROCESSES); foreach $data (@all_data) { # Forks and returns the pid for the child: my $pid = $pm->start and next; ... do some work with $data in the child process ... $pm->finish; # Terminates the child process }
In reply to Re: Reading Elements of an array in Parallel
by RichardK
in thread Reading Elements of an array in Parallel
by rahulruns
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |