> > Let's try this again :) You were most of the way there the first time, > and the shell script thing I suggested is unnecessary. > > system("command >/dev/null &"); # works for me > > Specifically: > > sleep.pl: > #!/usr/bin/perl > $|++; > print STDERR time." start of sleep\n"; > sleep(5); > print STDERR time." end of sleep\n"; > > sleep.cgi: > #!/usr/bin/perl > system('/path/to/sleep.pl >/dev/null &'); > print "Content-type: text/html\n\n"; > print "<h1>done printing</h1>".time; > > > Yes this works now......thanks Dave......
You have hell of patience :) Now since sleep.pl has been invoked by sleep.cgi, sleep.pl will spawn as child process with cgi script being the parent process. Then sleep.cgicannot stop until sleep.pl gets finished. So effectively, even though the html page is displayed to the user the sleep.cgi script will not exit and return to webserver. Is my understanding correct? If it is correct, then how do we make a new process independent of invoking process?