At 11:06 AM +0200 8/27/01, Pavel Smejkal wrote:
>if I am changing XXX value then I am get in perl code
>
>XXX      $?
>0            1
>1            1
>2            268435458
>3            3
>4            268435460
>5            4
>6            268435462
>7            7
>8            8
>
>Why I am don't get value XXX. What is I do wrong ?
>
>I am running  Perl 5.6.0 on Alpha OpenVMS V7.3

Looks good to me.  Here's a slightly modified version of your
procedure and script and the output I get with Perl 5.6.1 on OpenVMS
Alpha 7.3:

$ type foo.com
$ write sys$output "returning ''p1'"
$ return p1
$ type foo.pl
use vmsish 'status';

foreach (0..8) {
  $msg = `\@foo.com $_`;
  $msg =~ s/%.*\n?//m;
  chomp($msg);
  print "$msg from DCL and getting $? in Perl\n";
}
$ perl foo.pl
%NONAME-W-NOMSG, Message number 00000000
returning 0 from DCL and getting 1 in Perl
returning 1 from DCL and getting 1 in Perl
%NONAME-E-NOMSG, Message number 00000002
returning 2 from DCL and getting 2 in Perl
returning 3 from DCL and getting 3 in Perl
%NONAME-F-NOMSG, Message number 00000004
returning 4 from DCL and getting 4 in Perl
returning 5 from DCL and getting 5 in Perl
%NONAME-?-NOMSG, Message number 00000006
returning 6 from DCL and getting 6 in Perl
returning 7 from DCL and getting 7 in Perl
%SYSTEM-W-ACCVIO, access violation, reason mask=00, virtual address=0000000000000008, 
PC=0000000000000008, PS=00000000
returning 8 from DCL and getting 8 in Perl

Of course DCL interprets even numbers as failures and prints messages
accordingly.  Zero being mapped to one is something the C RTL does in
order to turn generic Unix-style success into generic VMS success.
But in general it looks to me like you are doing the right thing and
should see the same results I do.
-- 
____________________________________________
Craig A. Berry                  
mailto:[EMAIL PROTECTED]

"Literary critics usually know what they're
talking about. Even if they're wrong."
        -- Perl creator Larry Wall

Reply via email to