in reply to system and $?

If $? isn't -1, it means the shell was required and it was successfully executed. If the shell failed to execute the command, it will communicate this via $?. It chooses what value to return.

If you want more precise diagnostics, don't invoke the shell.

Replies are listed 'Best First'.
Re^2: system and $?
by rovf (Priest) on Aug 26, 2009 at 14:21 UTC
    If you want more precise diagnostics, don't invoke the shell.

    Actually, in my own programs I already use often IPC::Run::run, and I think I will convert the remaining system() calls to the use of either IPC::Run or IPC::System::Simple, but we are here dealing with programmers from many different departments, and it would be a bit restrictive to have everyone drop system(), so I was interested in alternatives. But thanks a lot for the information.

    -- 
    Ronald Fischer <ynnor@mm.st>