Thanks Craig.

Actually, it turned out to be even simpler than that.  

After getting your message, I tried your example, then whipped up a
oneliner of my own that was (I thought) identical, and was getting
different results.  

Case sensativity bites again, "use VMSish" doesn't work, but simply
fails silently.  "use vmsish" works as expected, otoh, whether or not I
specify 'status' as an argument.

So, my question now becomes, since I had "use strict" and "use
diagnostics", shouldn't my script at least have spit an error about
"can't find module VMSish", or something similar ?

Thanks,
-- Pat

"Craig A. Berry" wrote:
> 
> At 2:03 PM -0600 11/1/00, Patrick Spinler wrote:
> >
> >   exit $status >> 8;
> >
> >I get this result:
> >
> >   $ perl -w test.pl
> >   hi
> >   %SYSTEM-F-BADPARAM, bad parameter value
> >   $status = 4
> >   signal = 0
> >   core = 0
> >   %NONAME-F-NOMSG, Message number 00000004
> >
> >Running the program either as a "$ perl -w test.pl" or as "$ @test.pl",
> >and whether I have the "use VMSish;" statement commented or not.
> >
> >What's happening to the "real" DCL exit status value 0x14 ?  Why isn't
> >perl getting this ?
> 
> OK, I finally found this, and it is documented in perlvar.pod:
> 
> "Under VMS, the pragma C<use vmsish 'status'> makes C<$?> reflect the
> actual VMS exit status, instead of the default emulation of POSIX
> status."
> 
> So, you don't want "use VMSish" but rather "use vmsish 'status'".
> An example with and without:
> 
> $ perl -e "$x = system('nocommand'); print $x; exit($x);"
> %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
>   \NOCOMMAND\
> 256
> %SYSTEM-W-ILLSER, illegal service call number
> 
> [the Posix status of 256 obviously means something else to DCL]
> 
> $ perl -e "use vmsish 'status'; $x = system('nocommand'); print $x; exit($x);"
> %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
>   \NOCOMMAND\
> 229520
> %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
> 
> And for confirmation that it's got the right status:
> 
> $ write sys$output f$message(229520)
> %CLI-W-IVVERB, unrecognized command verb - check validity and spelling
> 
> $ search climsgdef.h ivverb
> #define CLI$_IVVERB 229520
> 
> --
> ____________________________________________
> Craig A. Berry
> mailto:[EMAIL PROTECTED]

-- 
      This message does not represent the policies or positions
             of the Mayo Foundation or its subsidiaries.
  Patrick Spinler                       email:  [EMAIL PROTECTED]
  Mayo Foundation                       phone:  507/284-9485

Reply via email to