PERL_VMS_POSIX_EXIT (Re: Q: Can anyone explain this cursious behaviour.)

[email protected] ("Craig A. Berry") Mon, 21 Jul 2014 19:06:58 -0500
Newsgroups perl.vmsperl
Message-ID <[email protected]>
On Jul 20, 2014, at 3:50 PM, John E. Malmberg <[email protected]> wrote:

> If you define PERL_VMS_POSIX_EXIT or DECC$FILENAME_UNIX_REPORT, it is supposed to behave the way that you would normally expect.

That depends on what you normally expect.  PERL_VMS_POSIX_EXIT should more or less give you posixish behavior regarding exit codes.  I can't think of a good reason to enable it unless you are running under bash.  DECC$FILENAME_UNIX_REPORT has nothing at all to do with exit statuses.

> From a quick test on Encompasserve with PERL 5.18, that feature does not appear to be working.
> 
> When that feature is working from DCL scripts or Bash you can recover the original Unix error code unless it is a VMS specific error.
> 
> I do not know why the PERL_VMS_POSIX_EXIT feature does not appear to be working, I have not built/tested perl on VMS for a few years.

Well it certainly does something:

$ define PERL_VMS_POSIX_EXIT 1
$ perl -e "$! = 66; die;"
Died at -e line 1.
$ show symbol $status
  $STATUS == "%X1035A212"

66 is ENOTEMPTY.  66 might be embedded in that $STATUS value somewhere, transmogrified by various kinds of masking and shifting, but I'm late for dinner and have no time to debug it at the moment.

________________________________________
Craig A. Berry
mailto:[email protected]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser