At 04:54 PM 2/15/00 -0500, Gregor N. Purdy wrote:
>Could you try to do a 'use Env qw(@FOO);' for some
>well-known VMS 'environment' array and see if you
>get the expected behavior when you loop over the
>entries? Your script should die() if you try to
>write to the array, though.

I don't think how well-known the array is is important, although there may be 
conventions that get us in trouble, such as the use of dollar signs.  For future 
reference, an "environment array" is under VMS called a logical name search list and 
is documented at:

<http://www.openvms.digital.com:8000/72final/6489/6489pro_030.html#createsearchlist>

As far as testing the cases likely to cause trouble, my Perl skills aren't up to 
giving an array the name DCL$PATH, for example, which would be one of the more common 
logical names associated with a search list; is '$' even allowed in variable names?  
It works ok as part of a logical name

$ perl -e "print $ENV{'SYS$LOGIN'};"
DISK8:[BERRYC]

but if Env.pm needs to directly map logical names to variable names that could cause 
trouble.

Ordinary array processing seems to work as expected, although it doesn't die, it just 
issues a warning and continues:

Here's my test program:
------vmsenv.t-----
use Env qw(@FOO);

foreach(@FOO) {  print "$_\n"; }
push @FOO, 'fum';       # should fail
if ($@) { die $@; }
print "I'm still here after the error.\n";
-----end of vmsenv.t

and here's what it gives me:

$ perl vmsenv.t
FEE
FI
FO
Environment arrays are read-only on VMS. Sorry. at /perl_root/lib/Env.pm line 240.
I'm still here after the error.
  
and here is the OS telling me what's in the FOO logical name:

$ show logical foo
    "FOO" = "FEE" (LNM$PROCESS_TABLE)
         = "FI"
         = "FO"
_______________________________________________
Craig A. Berry                                   
mailto:[EMAIL PROTECTED]

Reply via email to