See the documentation of die:
If an uncaught exception results in interpreter exit, the exit code is determined from the values of $! and $? with this pseudocode:exit $! if $!; # errno exit $? >> 8 if $? >> 8; # child exit status exit 255; # last resort
And likely, $! is set from some other operation that your script (or Perl) performed. So you can't rely on a specific exit code if your script dies.
If you need something really specific, you could install your own handler via either an END block or a $SIG{__DIE__} handler (perlvar).
In reply to Re: perl die & exit values
by Corion
in thread perl die & exit values
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |