From f4df373def033480516a6b0b9bd76e0182ce0024 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 14 Jul 2013 11:12:17 +0200 Subject: [PATCH] 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. --- install_lib.pl | 8 ++++---- installman | 3 +++ installperl | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/install_lib.pl b/install_lib.pl index e116343..0a63574 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 201be21..3f83909 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 04b3786..427786f 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'; } -- 1.8.3.1