At 12:15 08/03/2001, Kristofer Wolff wrote:
>hi all, I start a process with Proc::Simple,
>
>my question is: how can I read the PID from thses startinf process to kill
>it in an other programm ?
>
>
>use Proc::Simple;
>$myproc = Proc::Simple->new();        # Create a new process object
>$myproc->start("perl running.pl");        # Launch a shell process
>$running = $myproc->poll();           # Poll Running Process
>print "error" if($running == 0);
>$this_pid = ????????????????
>
>please help me the fix this problem !
>
>Thanx in advanced
>Kris

Kris,

I've used:

$PROCID =  $PROCNAME->GetProcessID();

with an example of code below.  I know this is using Win32::Process, but 
maybe Process::Simple has a similar function

use Win32::Process; use Win32;
Win32::Process::Create($PROCNAME,
                              "C:\\Perl\\bin\\perl.exe",
                              "perl sesme.pl $CONFDIR$SESCONF",
                              0,
                              NORMAL_PRIORITY_CLASS,
                              ".")|| die ErrorReport();
$PROCID =  $PROCNAME->GetProcessID();
print("ProcessID= $PROCID\n");

HTH

Roland


-- 
Roland Corbet
Systems Administrator & Developer
Psyche Solutions Limited
Chester Road
Cradley Heath
West Midlands
B64 6AB

Tel:    + 44 (0)1384 414183 Ext. 4412
Fax:    + 44 (0)1384 414111
Email:  [EMAIL PROTECTED]
WWW:   http://www.psyche.net.uk

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to