use Proc::Queue size=>5, qw(run_back); for (@ARGV) { run_back { run_code($_) }; } 1 while wait != -1;