[VPM] cross-platform detached process invoke method

Tyler MacDonald tyler at yi.org
Sat Feb 9 15:44:22 PST 2008


Jer A <jeremygwa at hotmail.com> wrote:
> whats a way to do this? it - should work on both Windows/*nix

  In the past, I've used IPC::Run3 for this.

> can this be done in a cgi script, where the script exits, leaving the
> child to exit on it's own?

  Now *that* can be tricky to do in a cross-platform way. The ideal way to
start a process in the background in Win32 is to use START.EXE (I think?
it's been awhile)... So you could have your script check the value of $^O,
and if it's win32, invoke START.EXE, otherwise use a shell construct to
start a process in the background.

> can this be done without loading any bulky modules?

  IPC::Run3 isn't bulky. :-)

> Thanks in advance for any help.

  One other thing to consider, is how you are going to prevent this cgi
script from invoking 1,000 scripts if the user keeps hitting 'reload'...
that can chew up windows' process table rather quickly.

  Cheers,
    Tyler


More information about the Victoria-pm mailing list