summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-07 09:13:10 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-07 09:13:10 +0000
commit29d82f8db02520fbd9de7355b9f87859201d969b (patch)
treef7b0f5fd466cfb1f310e11e2319740dbe37f3ccf /lib
parent2f8d19471fff6dce24515de40641f3664bd36e7f (diff)
downloadperl-29d82f8db02520fbd9de7355b9f87859201d969b.tar.gz
add compatible versions from $Config{inc_ver_list} to search
paths automatically (from Tom Hughes <tom@compton.nu>) p4raw-id: //depot/perl@5018
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/lib.pm b/lib/lib.pm
index 879af16ddd..e46c5fefa6 100644
--- a/lib/lib.pm
+++ b/lib/lib.pm
@@ -5,6 +5,7 @@ use Config;
my $archname = $Config{'archname'};
my $ver = $Config{'version'};
+my @inc_version_list = reverse split / /, $Config{'inc_version_list'};
our @ORIG_INC = @INC; # take a handy copy of 'original' value
our $VERSION = '0.5564';
@@ -23,12 +24,15 @@ sub import {
Carp::carp("Parameter to use lib must be directory, not file");
}
unshift(@INC, $_);
+ # Add any previous version directories we found at configure time
+ foreach my $incver (@inc_version_list)
+ {
+ unshift(@INC, "$_/$incver") if -d "$_/$incver";
+ }
# Put a corresponding archlib directory infront of $_ if it
# looks like $_ has an archlib directory below it.
- if (-d "$_/$archname") {
- unshift(@INC, "$_/$archname") if -d "$_/$archname/auto";
- unshift(@INC, "$_/$archname/$ver") if -d "$_/$archname/$ver/auto";
- }
+ unshift(@INC, "$_/$ver") if -d "$_/$ver";
+ unshift(@INC, "$_/$ver/$archname") if -d "$_/$ver/$archname";
}
# remove trailing duplicates