Welcome to WebmasterWorld Guest from 220.127.116.11
How to let perl scripts, 'sample.pl' run on background? And then that 'sample.cgi' can be loaded quickly.
I found a link about 'fork': [oreilly.com...]
I run that example in Unix, and it works (run child process in background).
But when I run it in Browser, it doesnot work. Browser (firefox) keeps on loading until child process finished, although we can close browser.
Form.html: where user fills information.
Sample.cgi: get information from Form.html
Job.pl: use infromation to execute some tasks (but it takes some time)
What I wanted is:
load Sample.cgi and tell user, job is running and email will be sent out when done.
Job.pl will be run on background.
Problem: Sample.cgi keeps on loading until Job.pl finished, although you can forcedly close Sample.cgi.
sample.cgi does some stuff
print "You will recieve an email shortly";
that should do it. When you run a program from the exec() function the current script is replaced by the new one and the old script is exited. job.pl runs and sends an email when finished.