use Parallel::ForkManager; $pm = new Parallel::ForkManager($MAX_PROCESSES); my @task_details = ( # data needed for each sub-process ); foreach my $task (@task_details) { $pm->start and next; # do the fork # do the sub process work using whatever details are in $task # write the results to a file somewhere, perhaps with a # pre-set name passed in $task $pm->finish; # do the exit in the child process } $pm->wait_all_children; # Continue in parent and read in the results