Regarding this statement from PERLDOC PERLVMS:

         The element "$ENV{DEFAULT}" is special: when read, it returns
         Perl's current default device and directory, and when set, it
         resets them, regardless of the definition of PERL_ENV_TABLES.  It
         cannot be cleared or deleted; attempts to do so are silently
         ignored.

In 5.6.1, at least, it looks like the act of evaluating "keys(%ENV)"
makes this no longer true:

<quote>

$ SHOW DEFAULT
  $1$DUA700:[SYS_SCRATCH]

$ SHOW LOGICAL DEFAULT
   "DEFAULT" = "FOO" (LNM$PROCESS_TABLE)

$ perl -e "print ""\n$ENV{DEFAULT}\n\n"" "

$1$DUA700:[SYS_SCRATCH]

$ perl -e "@var = keys(%ENV); print ""\n$ENV{DEFAULT}\n\n"" "

FOO

$ perl -v

This is perl, v5.6.1 built for VMS_AXP
  ...
$ WRITE SYS$OUTPUT "VMS Version " + f$getsyi ("version")
VMS Version V7.2-2

</quote>

I came across this because Env::import evaluates "keys(%ENV)" -- but
only if you don't specify specific variables you want it to tie.  So I
think the same change in behavior will occur if you have "use Env;"
anywhere in your program.  (But the effects are only visible if you also
have defined "DEFAULT" as a logical.)

One could regard this as a feechur, giving access to the otherwise
hidden logical name "DEFAULT"; but ... especially since Cwd::cwd, on
VMS, relies on the above-quoted statement's being true ... let's not,
OK? 

/       Tom Edelson
        VMS/Unix Release Engineering
        SAS Institute, Inc.

Reply via email to