It is not a matter of opposing standards. There are two
different things. First, there are the function calls,
whose behaviour is strictly defined (or else they would
be unusuable). At the C level, failure is often indicated
by a return value of
-1, or
NULL,
and the reason of failure is passed in a global variable,
errno. Not very intuitive (IMO), and Perl,
being the thin layer it is above Unix/C, only makes it
slightly more convenient. It returns
0 on
failure. The reason of failure is still passed in a global
variable,
$! (which explains that variable).
The return values of spawned process have nothing to do with
the shell. It's the other way around. Processes typically
return 0 indicating success, and anything else
for failure. There's no global variable to set, all they can
do is return a single integer. "0 on success"
is a mere convention. It's just because this
convention is followed so often, typical shell Boolean logic
is "reversed"; 0 is true, other integers are
false.
-- Abigail