This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use vmstrnenv() to look up PERL5LIB/PERLLIB on VMS.
authorCraig A. Berry <craigberry@mac.com>
Tue, 26 Jan 2016 02:45:39 +0000 (20:45 -0600)
committerCraig A. Berry <craigberry@mac.com>
Tue, 26 Jan 2016 03:01:25 +0000 (21:01 -0600)
We have, for a long time, only considered logical names when
looking for values of PERL5LIB. However, this makes us miss values
stored in the environ array (such as when happens when Perl is
invoked from bash) or as DCL symbols.

So make looking up PERL5LIB and PERLLIB use the lower level routine
that will look up values using the same search order as all other
environment handling in Perl, while still handling a list of paths
as a search list logical if that's where the value is stored.

N.B.  There is no change to the default path separator here, only
to lookup method.

perl.c

diff --git a/perl.c b/perl.c
index 17de92c..c7c1fe6 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -4386,12 +4386,12 @@ S_init_perllib(pTHX)
         */
        char buf[256];
        int idx = 0;
-       if (my_trnlnm("PERL5LIB",buf,0))
+       if (vmstrnenv("PERL5LIB",buf,0,NULL,0))
            do {
                incpush_use_sep(buf, 0, INCPUSH_ADD_SUB_DIRS);
-           } while (my_trnlnm("PERL5LIB",buf,++idx));
+           } while (vmstrnenv("PERL5LIB",buf,++idx,NULL,0));
        else {
-           while (my_trnlnm("PERLLIB",buf,idx++))
+           while (vmstrnenv("PERLLIB",buf,idx++,NULL,0))
                incpush_use_sep(buf, 0, 0);
        }
 #endif /* VMS */
@@ -4497,11 +4497,11 @@ S_init_perllib(pTHX)
         */
        char buf[256];
        int idx = 0;
-       if (my_trnlnm("PERL5LIB",buf,0))
+       if (vmstrnenv("PERL5LIB",buf,0,NULL,0))
            do {
                incpush_use_sep(buf, 0,
                                INCPUSH_ADD_OLD_VERS|INCPUSH_NOT_BASEDIR);
-           } while (my_trnlnm("PERL5LIB",buf,++idx));
+           } while (vmstrnenv("PERL5LIB",buf,++idx,NULL,0));
 #endif /* VMS */
     }