#Execute 10 number of calls foreach (1..$cps) { #Child Process Starts Here my $pid = $pm->start and next; if (defined $proxy) { $ENV{http_proxy}="$proxy"; } `curl -o /dev/null -m 222 \"$Link\" 2>&1`; #child process ends here $pm->finish; } #wait for 10 calls to terminate and then pump another 10 calls. if ($callsRunning == $calls_at_a_time) { $pm->wait_children($cps); $callsRunning -= $cps; } }