use Parallel::ForkManager; ... my $pm = new Parallel::ForkManager(10); # max 10 processes simultaneously foreach my $job_id (keys %$results) { $pm->start and next; # do the fork system("perl -w script.pl $job_id"); $pm->finish; # do the exit in the child process } $pm->wait_all_children;