in reply to Detached forking in a CGI script

you have the logic of your script backwards
my $pid = fork(); if ($pid) { # We're the child and we need to start the analysis
fork returns 0 (zero) in the child, and non-zero (pid of the child) in the parent. Since 0 is false in Perl, if ($pid) block will be run by the parent.