in reply to How to capture system return code when command launched in the background?
In general you have to wait for the external program to terminate to obtain its exit code. I'm not sure if waitpid or wait support obtaining the return value; if not you have to fork yourself, and start the program in foreground, and collect the return value, and then use some IPC to signal that back to the parent process. Sounds nasty...
Luckily IPC::Run abstracts that away with start() and finish() - which I'd recommend to use.
|
---|