in reply to Re: (3) Launch background perl script from CGI
in thread Launch background perl script from CGI

Sorry I missed that!
However, `C:\\Perl\\bin\\perl.exe generate_report.pl &`; does not work in win-2000. It still runs the job in the foreground!
  • Comment on Re: (4) Launch background perl script from CGI

Replies are listed 'Best First'.
Re: (5) Launch background perl script from CGI
by edan (Curate) on Dec 11, 2003 at 07:08 UTC

    I believe the 'quick-and-dirty' way to run a process in the background on a Win32 platform is:

    system('start /b yourcommand');

    HTH

    --
    3dan

Re: (5) Launch background perl script from CGI
by Roger (Parson) on Dec 11, 2003 at 06:50 UTC
    The & worked for me on XP so I assumed that it would work for you. Anyway, there are several modules that will create background processes for you on Windows NT/2K/XP platforms. Such as Proc::Background and Win32::Process on CPAN.
    use Proc::Background; my $proc = Proc::Background->new("C:\\Perl\\bin\\perl.exe generate_rep +ort.pl");
    Will kick off a background process via Win32::Process, instead of relying on the shell to create a background process.