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

-- 
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