RE: Windows Background Process

2001-06-28 Thread murphy, daniel (BMC Eng)

I have this snippet of code that I picked up from Learning Perl on Win32
Systems (O'Reilly) that may be helpful. For more info, check the
Win32::Process module. As a Perl rookie myself, I really can't explain it -
I just know it works. ;-)


use Win32::Process;

Win32::Process::Create($Process,
c:\\program files\\ultraedit\\uedit32.exe,
uedit32 $alljobs_list ,
0,
DETACHED_PROCESS,
.)||  die Creating UltraEdit process: $!;






Dan Murphy   [EMAIL PROTECTED]   
EMC Corp.508-435-1000 x14559
Hopkinton, MA  01748

EMC2
where information lives




-Original Message-
From: C.Ouellette [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 6:17 AM
To: [EMAIL PROTECTED]
Subject: Windows Background Process


Hello,

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.

Lastly, I've been monitoring this list for a few weeks
now. It has been extremely helpful in getting me
started with Perl. Thank you to everyone involved.

Tina Ouellette

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Windows Background Process

2001-06-27 Thread C.Ouellette

Hello,

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.

Lastly, I've been monitoring this list for a few weeks
now. It has been extremely helpful in getting me
started with Perl. Thank you to everyone involved.

Tina Ouellette

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: Windows Background Process

2001-06-27 Thread Me

 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.