Take a look at errno.h in your local C compiler include directory. 13 translates to EACCESS which marries up with your 'permission denied'.
From that I guess it is safe to assume that perl.exe uses the appropriate unix-style error code as exit values.
It would be nice if this was tagged in perlrun somewhere, but it probably the default expectation for unix tools and so doesn't rate a mention.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
| [reply] |
It would be nice if this was tagged in perlrun somewhere, but
it probably the default expectation for unix tools and so doesn't rate a mention.
It isn't. The default for most unix utilities is to just exit with
1 (or 255 for a few)[1].
Test exits with 1 for false condition and 2 for an error.
A few programs give a detailed error code depending on the error.
I however have never seen any (other than Perl)
that would use the ERRNO code as a return value.
Ruby exits with 1 no matter what.
Update: I have $? printed in my bash prompt, that's how I know.
[1]: I'm not sure in that.
Update:
The glibc manual says
... it does not work to use the value of `errno' as
the exit status--these can exceed 255.
This is not yet actual as the errno codes are less than 126 in
my system, but there might be much more in later systems.
(There are 252 syscalls in linux, they will soon exceed one byte.
Lucky the number is stored in %eax so we can have up to 4G syscalls
and 2G errno values:)
| [reply] |
| [reply] |