Date: 11 Sep 2001 22:45:20 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: to get the process ID of a running process
Message-Id: <slrn9pt4s9.22t.damian@puma.qimr.edu.au>

Luke Vanderfluit chose Wed, 12 Sep 2001 05:27:39 +0930 to say this:
>...
>$PID = open(KEEP, "keepLinkUp > /dev/null &|");
>
>But when I do a 'ps auxw' and look at the actual ID, it is $PID + 1,
>why is this?
>

You are starting a shell to interpret the contents of the string that is
the second argument to open(). The shell starts the 'keepLinkUp' in the
background then exits. The PID is that of the shell, not 'keepLinkUp'.

I don't understand why you are trying to read (via the pipe) from a process
whose stdout is already redirected to /dev/null. You might be interested to
look at 'Safe pipe opens' in perlipc for another way to do the above.

HTH

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)


