CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
spawning processes in cgi-bin



Apr 23, 2000, 10:15 AM

Post #1 of 1 (1842 views)
spawning processes in cgi-bin Can't Post

I'm having trouble getting my script to spawn a process (this process needs to output to a file). I would like my script to call (which might take a long time to run) and return with a message saying the process has started. The following script runs perfect on the server (i.e. when I type in, it spawns and is able to create the output file), but when I use my browser to run it, the output file isn't generated. I've changed all the permissions to 777 for both my cgi-bin and the .pl files.

Here's the listing to


$time = time().".rpt";
$http = "";

$child_id = fork();
die "fork failed: $!" unless defined $child_id;

if ($child_id)
print "Content-type: text/html\n\n";
print "<html>\n<head><title>Forking new process</title></head>\n<body>\n<h1>The parent reaped child $child_id, with status $?</h1>\n</body>\n</html>\n";
} else
exec " -b -l 2 -o $time $http" &#0124; &#0124; die "Exec $!";
exit 0;




Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives