The reason system doesn't work is that it waits for the child process to return. The solution is to use fork and then exec. When running under a web server, you must close STDERR and STDOUT, or the browser won't know that the CGI script has finished.
if ($pid = fork()) { # parent } else { die "Cannot fork:$!" unless defined $pid; close(STDOUT); close(STDERR); exec("otherscript.pl"); }
In reply to Re: LWP Forking
by iburrell
in thread LWP Forking
by Mitch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |