From: Gurusamy Sarathy Date: Mon, 10 Jan 2000 01:18:04 +0000 (+0000) Subject: use $Config{version} rather than $] where appropriate X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0ff3fa1a9e904b2e8741c50731fed324d1b1afb7;p=p5sagit%2Fp5-mst-13.2.git use $Config{version} rather than $] where appropriate p4raw-id: //depot/perl@4777 --- diff --git a/lib/CPAN.pm b/lib/CPAN.pm index 432e72d..2f22b77 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -3325,7 +3325,8 @@ sub perl { $perl ||= $candidate if MM->maybe_command($candidate); unless ($perl) { my ($component,$perl_name); - DIST_PERLNAME: foreach $perl_name ($^X, 'perl', 'perl5', "perl$]") { + DIST_PERLNAME: + foreach $perl_name ($^X, 'perl', 'perl5', "perl$Config::Config{version}") { PATH_COMPONENT: foreach $component (MM->path(), $Config::Config{'binexp'}) { next unless defined($component) && $component; diff --git a/lib/ExtUtils/Installed.pm b/lib/ExtUtils/Installed.pm index dda594e..41f3c9b 100644 --- a/lib/ExtUtils/Installed.pm +++ b/lib/ExtUtils/Installed.pm @@ -56,7 +56,7 @@ my $self = {}; # Read the core packlist $self->{Perl}{packlist} = ExtUtils::Packlist->new("$Config{installarchlib}/.packlist"); -$self->{Perl}{version} = $]; +$self->{Perl}{version} = $Config{version}; # Read the module packlists my $sub = sub diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 438ab01..f4329e1 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -2004,7 +2004,8 @@ usually solves this kind of problem. push @defpath, $component if defined $component; } $self->{PERL} ||= - $self->find_perl(5.0, [ $self->canonpath($^X), 'miniperl','perl','perl5',"perl$]" ], + $self->find_perl(5.0, [ $self->canonpath($^X), 'miniperl', + 'perl','perl5',"perl$Config{version}" ], \@defpath, $Verbose ); # don't check if perl is executable, maybe they have decided to # supply switches with perl diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index cfc1e7d..9dcedbf 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -78,7 +78,7 @@ sub _write_os2 { } my $distname = $data->{DISTNAME} || $data->{NAME}; $distname = "Distribution $distname"; - my $comment = "Perl (v$]$threaded) module $data->{NAME}"; + my $comment = "Perl (v$Config::Config{version}$threaded) module $data->{NAME}"; if ($data->{INSTALLDIRS} and $data->{INSTALLDIRS} eq 'perl') { $distname = 'perl5-porters@perl.org'; $comment = "Core $comment"; diff --git a/lib/Pod/Man.pm b/lib/Pod/Man.pm index 87de42e..9aadd42 100644 --- a/lib/Pod/Man.pm +++ b/lib/Pod/Man.pm @@ -338,9 +338,10 @@ sub initialize { # but we shouldn't need that any more. Get the version from the running # Perl. if (!defined $$self{release}) { - my ($version, $patch) = ($] =~ /^(.{5})(\d{2})?/); - $$self{release} = "perl $version"; - $$self{release} .= ", patch $patch" if $patch; + my ($rev, $ver, $sver) = ($] =~ /^(\d+)\.(\d{3})(\d{0,3})$/); + $sver ||= 0; $sver *= 10 ** (3-length($sver)); + $rev += 0; $ver += 0; $sver += 0; + $$self{release} = "perl v$rev.$ver.$sver"; } # Double quotes in things that will be quoted. diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index 532505e..e6a9127 100755 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -181,10 +181,10 @@ if ($^O eq 'VMS') { } @trypod = ( "$archlib/pod/perldiag.pod", - "$privlib/pod/perldiag-$].pod", + "$privlib/pod/perldiag-$Config{version}.pod", "$privlib/pod/perldiag.pod", "$archlib/pods/perldiag.pod", - "$privlib/pods/perldiag-$].pod", + "$privlib/pods/perldiag-$Config{version}.pod", "$privlib/pods/perldiag.pod", ); # handy for development testing of new warnings etc diff --git a/lib/lib.pm b/lib/lib.pm index d35510d..afc979b 100644 --- a/lib/lib.pm +++ b/lib/lib.pm @@ -4,6 +4,7 @@ use vars qw(@ORIG_INC); use Config; my $archname = $Config{'archname'}; +my $ver = $Config{'version'}; @ORIG_INC = @INC; # take a handy copy of 'original' value @@ -26,7 +27,7 @@ sub import { # looks like $_ has an archlib directory below it. if (-d "$_/$archname") { unshift(@INC, "$_/$archname") if -d "$_/$archname/auto"; - unshift(@INC, "$_/$archname/$]") if -d "$_/$archname/$]/auto"; + unshift(@INC, "$_/$archname/$ver") if -d "$_/$archname/$ver/auto"; } }