in reply to Re: Is fork() my answer to using dual-cpu?
in thread Is fork() my answer to using dual-cpu?
exec("shell_script < $input_file") unless $pid;
...since otherwise the parent will exec as well. FWIW, when I use fork() most of the time I write it in the following "template", comments and all ...
my $pid = fork(); die "failed to fork: $!" unless defined $pid; unless ($pid) { # child die; } # parent
... and then fill in the code later. That way it's harder for me to mess it up. :-)
|
|---|