in reply to Re^2: system and $?
in thread system and $?
If myprog.exe can not be run, system(...) returns on my platform 256 (which is exit code 1, no child-error), and, as you point out, sets $! to some error code.
You have a broken Perl if that's true.
If myprog can not be run, system sets $? to -1 and sets the error in $!.
If a shell command cannot be run, system sets $? to something other than -1 (since the shell was successfully executed) and $! contains no meaningful information. The shell cannot possibly change the parent's errno.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: system and $?
by Anonymous Monk on Aug 26, 2009 at 14:07 UTC | |
by ikegami (Patriarch) on Aug 26, 2009 at 14:12 UTC | |
|
Re^4: system and $?
by rovf (Priest) on Aug 26, 2009 at 14:18 UTC | |
by ikegami (Patriarch) on Aug 26, 2009 at 14:22 UTC |