in reply to Detect Process End

If you know the process ID, use the built-in kill() command with the 0 signal.
while( kill( 0, $pid ) ) { ... }
Or did you already try that? What's your process doing after you try to kill it?
--
brian d foy <bdfoy@cpan.org>

Replies are listed 'Best First'.
Re^2: Detect Process End
by rcolman (Acolyte) on Nov 27, 2004 at 05:41 UTC
    After I send a kill 15, $a, it takes a long time for the process to end -- like 20 to 30 minutes. So, I need to pause program execution until the process REALLY ends.

    I have not tried( kill( 0, $pid ) ) { ... }

      What is kill 0 (instead of kill 15)???
        kill 0 basically asks that PID if it's still alive or not. If you try a kill 0 on a PID that doesn't exist, you'll get false back. Be careful, though. Because Unix PIDs are recycled, there's no guarantee that the process that currently has the PID that you're looking at is the process that you think it is...

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come