#!/usr/bin/perl use warnings; use strict; use Uber qw / client_list /; use Parallel::ForkManager; my $max_forks = 2; # Changed to 2 just to see if it would go to the next one... my $clients = client_list(); my $fork = new Parallel::ForkManager($max_forks); for my $client ( @$clients ){ $fork->start( $client->{id} ) and next; do_something( $client->{id} ); $fork->finish; } sub do_something { my $client = shift; system( "perl", "C:/Path/To/Folder/process.pl", "$client" ); } $fork->wait_all_children