in reply to Catching "exit code" from IPC::Open3
From IPC::Open3 pod
open3() does not wait for and reap the child process after it exits. Except for short programs where it's acceptable to let the operating system take care of this, you need to do this yourself. This is normally as simple as calling waitpid $pid, 0 when you're done with the process.
From perlfunc:waitpid
Waits for a particular child process to terminate and returns the pid of the deceased process, ... The status is returned in $?.
So,I think the answer is that you need to call waitpid with the $pid returned by open3() and then inspect $? to retrieive the exit status.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Catching "exit code" from IPC::Open3
by fedelman (Novice) on Jun 22, 2004 at 22:43 UTC | |
by BrowserUk (Patriarch) on Jun 23, 2004 at 00:38 UTC |