From: [email protected]
[mailto:[email protected]] On Behalf Of Ashley
Hoff
Sent: 15 August 2012 03:52
To: [email protected]
Subject: Is there a range of Standard Perl Exit Codes?
> Greetings All,
> This info seems to be harder to find then I expected, but is there a range of
> standard exit codes that relate > to Perl keeling over itself? I have been
> using my own exit codes where necessary, but am getting some cross
> pollination with the exit codes that Perl assigns itself. All I want to do
> is ensure that exit codes that I
> assign are well out of that range.
There could be others, but the only references to exit codes that I am aware of
are in 'perldoc perlrun' and 'perldoc -f die'.
As far as I can see, the only exit code that perl itself assigns is when
compilation fails, or it detects a run time error, and the only one I recall
seeing is 255. Other exit codes are as a result of calls to die or exit by the
script (including any modules used), including the implied exit(0) when it
falls off the end.
>From what 'perldoc -f die' says, the exit code could, in theory, be pretty
>much anything. If you wanted to make the exit code as a result of calling die
>more predictable, you could try intercepting it by setting $SIG{__DIE__}. You
>could then call exit with whatever code you wanted, after you have output the
>error message, that is. However, I would be careful about doing this as there
>could be some odd side effects, depending on how the modules that you use
>behave.
It might be worth looking for alternate method of achieving your desired
result, which isn't entirely clear.
HTH
--
Brian Raven
Please consider the environment before printing this e-mail.
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient or have received this e-mail in error, please advise
the sender immediately by reply e-mail and delete this message and any
attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs