C:\>type test.pl use Parallel::ForkManager; $|++; # unbuffer output my @collections = qw (col1 col2 col3 col4 col5); my $max_tasks = 3; $pm = new Parallel::ForkManager($max_tasks); for my $collection (@collections) { my $pid = $pm->start and next; # do something with $collection in kid do{print "$_\t$collection\n"; sleep 1 } for 1..2; # kill kid $pm->finish; } C:\>perl test.pl > out C:\>type out 1 col1 1 col2 1 col3 2 col1 2 col2 2 col3 1 col4 1 col5 2 col4 2 col5 C:\>