for my $i (@list) { my $status = fork(); if ($status < 0) { # error condition } elsif ($status = 0) { # in child } else { # in parent } }