<p>I've had some trouble forking of processes from a Perl CGI script when running on Windows. The main issue seems to be that 'fork' is emulated when running on windows, and doesn't actually seem to create a new process (just another thread in the current one). This means that web servers (like IIS) which are waiting for the process to finish continue waiting until the 'background' process finishes.</p>

<p>Is there a way of forking off a background process from a CGI script under Windows? Even better, is there a single function I can call which will do this in a cross platform way?</p>

<p>(And just to make life extra difficult, I'd really like a good way to redirect the forked processes output to a file at the same time).</p>

perlfork
:
Perl provides a fork() keyword that
  corresponds to the Unix system call of
  the same name. On most Unix-like
  platforms where the fork() system call
  is available, Perl's fork() simply
  calls it.
On some platforms such as Windows
  where the fork() system call is not
  available, Perl can be built to
  emulate fork() at the interpreter
  level. While the emulation is designed
  to be as compatible as possible with
  the real fork() at the the level of
  the Perl program, there are certain
  important differences that stem from
  the fact that all the pseudo child
  ``processes'' created this way live in
  the same real process as far as the
  operating system is concerned.