in reply to Re: basic fork question
in thread basic fork question

I would like to suggest a better way of handling a fork:
if (!defined($pid = fork())) { # FAILURE # parent process } elsif ($pid == 0) { # SUCCESS # child process } else { # SUCCESS # parent process }
This one is more fail-safe, since you omitted the situation of a fork() failure.