> -----Original Message-----
> From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 07, 2002 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: RE:pidof a process
> 
> 
> Hi, Iw onder if there is a way to obtain the PID of a process 
> with perl?
> Thanks.

Do you mean your perl process? It's in the $$ variable.

getppid() will return the PID of your process' parent.

To get the id's of your children, you need to save the
return values from fork() or pipe open().

To get the PID of an unrelated process is an OS-specific
task, AFAIK. Some processes write their PID to a file. Or
you can examine the output of ps(1) or the like.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to