[ID 20000803.006] 'use lib ...' doesn't behave as documented
[p5sagit/p5-mst-13.2.git] / lib / lib_pm.PL
index 0d2a73b..bb02106 100644 (file)
@@ -23,7 +23,8 @@ print "Extracting $file (with variable substitutions)\n";
 print OUT <<"!GROK!THIS!";
 package lib;
 
-use 5.005_64;
+# THIS FILE IS AUTOMATICALLY GENERATED FROM lib_pm.PL.
+# ANY CHANGES TO THIS FILE WILL BE OVERWRITTEN BY THE NEXT PERL BUILD.
 
 my \$archname = "$Config_archname";
 my \$ver = "$Config_ver";
@@ -56,6 +57,7 @@ sub import {
         }
        # Put a corresponding archlib directory infront of $_ if it
        # looks like $_ has an archlib directory below it.
+       unshift(@INC, "$_/$archname") if -d "$_/$archname/auto";
        unshift(@INC, "$_/$ver") if -d "$_/$ver";
        unshift(@INC, "$_/$ver/$archname") if -d "$_/$ver/$archname";
     }
@@ -73,6 +75,8 @@ sub unimport {
     foreach (@_) {
        ++$names{$_};
        ++$names{"$_/$archname"} if -d "$_/$archname/auto";
+       ++$names{"$_/$ver"} if -d "$_/$ver";
+       ++$names{"$_/$ver/$archname"} if -d "$_/$ver/$archname";
     }
 
     # Remove ALL instances of each named directory.