in reply to Is fork() my answer to using dual-cpu?

use Proc::Queue to limit the max. number of concurrently forked processes:
use Proc::Queue size => 2, qw(system_back); for (1..$total_number_of_runs) { system_back "shell_script < $input_file" } # and wait for all your children to finish 1 while wait != -1;