diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-07-14 11:12:17 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-07-23 13:39:51 +0200 |
commit | f4df373def033480516a6b0b9bd76e0182ce0024 (patch) | |
tree | 28dff4378a376300603c29e3b49128ddd259cbb0 | |
parent | a01f566143b97d5d074775e31bd511a83044cab6 (diff) | |
download | perl-f4df373def033480516a6b0b9bd76e0182ce0024.tar.gz |
In install_lib.pl, no need to Config->import for the relocatableinc setup.
require Config; within the BEGIN block instead of using it outside it to
save creating one implicit BEGIN block, and running its import twice.
Remove the require 5.004; as the require of Config will fail if running
with anything other than the version about to be installed.
Note in installperl and installman that install_lib.pl imports Config.
-rw-r--r-- | install_lib.pl | 8 | ||||
-rwxr-xr-x | installman | 3 | ||||
-rwxr-xr-x | installperl | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/install_lib.pl b/install_lib.pl index e1163433fe..0a63574389 100644 --- a/install_lib.pl +++ b/install_lib.pl @@ -9,9 +9,9 @@ use vars qw($Is_VMS $Is_W32 $Is_OS2 $Is_Cygwin $Is_Darwin $Is_NetWare use subs qw(unlink link chmod); require File::Path; -use Config; BEGIN { - if ($Config{userelocatableinc}) { + require Config; + if ($Config::Config{userelocatableinc}) { # This might be a considered a hack. Need to get information about the # configuration from Config.pm *before* Config.pm expands any .../ # prefixes. @@ -19,7 +19,7 @@ BEGIN { # So we set $^X to pretend that we're the already installed perl, so # Config.pm does its ... expansion off that location. - my $location = $Config{initialinstalllocation}; + my $location = $Config::Config{initialinstalllocation}; die <<'OS' unless defined $location; $Config{initialinstalllocation} is not defined - can't install a relocatable perl without this. @@ -34,8 +34,8 @@ OS # You never saw us. We weren't here. require Config; - Config->import; } + Config->import; } if ($Config{d_umask}) { diff --git a/installman b/installman index 201be21da2..3f83909d42 100755 --- a/installman +++ b/installman @@ -1,10 +1,13 @@ #!./perl -w + BEGIN { @INC = qw(lib); # This needs to be at BEGIN time, before any use of Config + # install_lib itself loads and imports Config into main:: require './install_lib.pl'; } + use strict; use Getopt::Long; diff --git a/installperl b/installperl index 04b3786238..427786f72b 100755 --- a/installperl +++ b/installperl @@ -1,12 +1,12 @@ #!./perl -w BEGIN { - require 5.004; chdir '..' if !-d 'lib' and -d '../lib'; @INC = 'lib'; $ENV{PERL5LIB} = 'lib'; # This needs to be at BEGIN time, before any use of Config + # install_lib itself loads and imports Config into main:: require './install_lib.pl'; } |