in reply to Long running task from web app

The simplest mechanism is

if( $^O eq 'MSWin32' ) { system 1, 'path/to/script.pl'; } else { ## assume some flavour of *nix system '/path/to/script.pl &'; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Long running task from web app
by astroboy (Chaplain) on Mar 04, 2006 at 22:34 UTC
    Cheers. Regarding
    system 1, 'path/to/script.pl';

    I've never seen this before. What does the "1," mean?

      It's a Win32-only extention that causes system to create a detached process.

      I seem to recall that someone recently gave a reference to a document that mentioned it somewhere, but I don't recall who or where :( That said, there is not much to know, pass 1 as the first parameter and system doesn't wait for the command to finish before returning.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.