You cannot rely on the $! containing anything
useful if a child process has set it and died. It sometimes
happens, but there's nothing that garantees this. And it's
very unportable.
And $? will contain whatever exit value the spawned
program returned. This may be non-zero in the case of an
error - but that is only a convention, not law. And programs
can issue warnings on stderr, while completing a
task succesfully.
Just use IPC::Open3.
-- Abigail | [reply] |