From 2a7d49a8044f8390432327de51d29a8d67142554 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Wed, 2 May 2001 21:18:32 +0000 Subject: [PATCH] - Avoid circular `use Config', which may lead to random synax errors produced by miniperl during buildworld phase. - While at it, do loading of SelfLoader only when it is needed, and in place where it is needed. Submitted by: tobez@tobez.org (who is doing way too much good work and is in need of the Commit Bit punishment) --- gnu/usr.bin/perl/BSDPAN/BSDPAN.pm | 12 +++++++----- gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm b/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm index 8b9e3f3d6fd..908f03f60aa 100644 --- a/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm +++ b/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm @@ -11,7 +11,6 @@ package BSDPAN; # # The pod documentation for this module is at the end of this file. # -use Config; my $bsdpan_path; # Directory pathname of BSDPAN itself @@ -34,19 +33,22 @@ sub path { } sub perl_version { - return $Config{version}; + require Config; + return $Config::Config{version}; } sub perl_ver { + require Config; # pre-5.6.0 perls - return $Config{apiversion} if exists $Config{apiversion}; + return $Config::Config{apiversion} if exists $Config::Config{apiversion}; # post-5.6.0 perls - return $Config{version}; + return $Config::Config{version}; } sub perl_arch { + require Config; # pre-5.6.0 perls - return $Config{archname} if exists $Config{apiversion}; + return $Config::Config{archname} if exists $Config::Config{apiversion}; # post-5.6.0 perls return 'mach'; } diff --git a/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm b/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm index 10dc2d610a8..4873d300fb1 100644 --- a/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm +++ b/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm @@ -13,9 +13,8 @@ package BSDPAN::Override; # use strict; use Carp; +use BSDPAN; require Exporter; -require SelfLoader; # XXX 2nd-order magic over SelfLoader's magic :-) -# require AutoLoader; # XXX do we need to do similar hoop-la with it? use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); @@ -77,8 +76,11 @@ sub override ($$) { # do we need to protect against SelfLoader? my $sl_autoload = eval "*$pkg\::AUTOLOAD{CODE}"; - $sl_autoload = 0 - if $sl_autoload && $sl_autoload != \&SelfLoader::AUTOLOAD; + if ($sl_autoload) { + require SelfLoader; + $sl_autoload = 0 + if $sl_autoload != \&SelfLoader::AUTOLOAD; + } # get the reference to the original sub my $name_addr = eval "*$name\{CODE}";