Hi,

 

My cgi script needs to do some dirty work. User is supposed to be notified via email when the job is done.

 

Here is the use case

 

a)       user clicks submit on a form to start the job

b)       An instant message is thrown back to the user saying the job has started successfully and user would be notified via email

c)       Later an email notification arrives

 

Script looks something like below

 

1. print ("Location: http://XYZ:9090/Project/filepath.html\n\n");

2. close(STDOUT);

 

3. my $pid = fork;

4. $pid = 0 unless defined $pid;   # be the kid if fork failed

5. exit 0 if $pid;

## child...

6. close(STDOUT);

 

### LONG DIRTY JOB START

7. exec "la_results.pl $input{'dirPath'} $checkboxString";

### LONG DIRTY JOB OVER

 

8. mail.pl $loginId ## MAIL THE NOTIFICATION

 

Issue is that the after submit of the page, the IE still keeps loading the page until the long\dirty job is over.

 

How can I make line 1 come up as an instant page.

 

Thanks for your help

Raj

Reply via email to