my $child_id = fork; unless (defined $child_id) { die "Can't fork!"; } if ($child_id) { #in parent... } else { #in child }