At 1:37 PM +0100 5/31/01, [EMAIL PROTECTED] wrote:
>I'm spawning a process from within a perl script and then doing a waitpid
>on it and checking the return status,
>I am looking at $? which appears to return the pid and a status in the
>next 8 bits.
>
>However I really need to see the VMS exit status , the documentation
>perlvms.pod seems to suggest that this will be contained in $^S
>however it appears to be always blank. ( perl version 5.6.1)
For the record, here's what's in perlvms.pod:
=item $^S
Under VMS, this is the 32-bit VMS status value returned by the
last subprocess to complete. Unlike C<$?>, no manipulation
is done to make this look like a POSIX wait(5) value, so it
may be treated as a normal VMS status value.
-------
I see the following with both 5.6.1 and bleadperl:
$ perl -e "$pid=open(F, qq/|blechh/); waitpid($pid,0); print qq/** $^S **/;"
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
\BLECHH\
\BLECHH\
** **
So yes it's blank as Tony reports. With 5.5.3 I sometimes see a
value of "0" for $^S but it usually hangs before it gets there.
Since zero is not a valid VMS status, it doesn't look like it worked
as documented back then either, so I'm wondering if this is something
that just never got implemented.
The list archives are silent on the matter, though there were some
arguments back in '97 about what status values should mean on various
platforms. Does anyone know anything about this, or where to even
look in the Perl sources for where this could/should be implemented?
Does my example really prove what I think it does, or am I missing
something?
--
____________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"Literary critics usually know what they're
talking about. Even if they're wrong."
-- Perl creator Larry Wall