"Daryl J. Hoyt" wrote:
> 
> Hi,

Hello,

>     I have a problem I can not seem to figure out.  I need run an executable
> from a Perl script and I want it to return the PID for the executable.  I
> looked at the docs for fork(), but if I did something like:
> if($PID = fork)
> {
>     system("foo.exe");
> }
> I think it would return the PID for the fork in the if statement and not the
> one from the system call.  Is there any way to get the PID from the child?
> Any help would be greatly appreciated.

The problem is that system() forks as well.  Use exec() and the PID
returned from fork() will be the PID that "foo.exe" is running as.



John
-- 
use Perl;
program
fulfillment

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

Reply via email to