> I need to start an external program from my perl
> script.  This program will need to run in the
> background so my script can continue doing other
> things.  It also still needs to notify the program
> when it terminates.
> 
> I would appreciate any help on how I would do this. 
> My environment is Windows NT 4.0, with Activestate
> perl 5.6.1.  I'm also not sure how Windows runs a
> background process, so any tips there would be
> appreciated.

No one else has attempted to answer this (too busy
having fun out obfuscating each other ;>), so even
though I'm not well qualified to answer, I'll have a go.

Basically, afaik, windows doesn't have a native way
of doing this at the OS level, at least afaik. But all is
not lost; read on.

On unix like OSes, the main piece relevant to this
is called a 'fork'. In  a nutshell, a given process has
a child, resulting in the original process (parent) and
the child.

Perl has a high level function, also called 'fork', that
makes use of this. It uses native forking capabilities
on unix like OSes, and emulations on some other
OSes, and simply isn't available on yet other OSes.
With perl 5.6, on some versions of Windows, a fork
emulation has been written. It is likely to be quite
slow, but it may well be usable. So, try that.

For more info:

    perldoc -f fork

Apparently, a module called Win32::Process is also
available for this sort of thing and may be a lot faster.

hth.

Reply via email to