# UNTESTED for $line (@whatever) { $pid = fork(); # 0 in child, child's pid in parent if ($pid) { # in parent process push @pids, $pid; } else { #child processe &VF4($line); exit; } } for ( @pids ) { waitpid($_,0) } # wait for all children