Bob Showalter wrote:

JupiterHost.Net wrote:

I don't want the user to wait
at all, just submit the form, they see the confirmation and close
their browser and the fork() finished in its own sweet time on the
server.


Use something like the following:

  #!/usr/bin/perl

  use strict;
  use CGI ':standard';
  use POSIX 'setsid';

  defined(my $pid = fork) or die "Couldn't fork: $!";
  if ($pid) {
      print header,
          start_html,
          p("Process $pid has been started"),
          end_html;
      exit;
  }

  close STDIN;
  close STDOUT;
  setsid();

  # at this point your process is detached from the web server,
  # so start your long-running process now


Thanks Bob, That works great! Now the next step is to play with that in a peristent environment without killing the persistent process with the exit() Perhapst the system + & will do better in a persistent environement...
I'll have to play around with those now and see :)


Thanks to every one who helped me out!



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to