use strict; use warnings; foreach (@ARGV) { die "Fork failed: $!\n" unless defined (my $pid = fork); exit &process($_) unless $pid; } 1 until -1 == wait; ...