Bzzzt! That should read:my $PID = fork(); if ($PID) { # in the parent process } else { # in the child process }
Always, always, always check the return values of your system calls. And that includes fork.my $PID = fork(); if ($PID) { # in the parent process } else { # in either the child process or the parent # process, depending on whether the fork() # succeeded or failed. }
Abigail
In reply to Re: fork() && exit;
by Abigail-II
in thread fork() && exit;
by onegative
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |