Because the return from system() will be non-zero and thus true in Perl's
view. If you are using vmsish status you'll have to test for low bit clear
on the return status just as you would in a native VMS language.
-----Original Message-----
From: Patrick Spinler
To: Craig A. Berry
Cc: [EMAIL PROTECTED]
Sent: 11/3/00 9:57 AM
Subject: Re: Exit status from &system() ??
And one more thing, why doesn't the construct:
system ('blah') || warn "something";
work ?
-- 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