summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-05-02 21:18:32 +0000
committermarkm <markm@FreeBSD.org>2001-05-02 21:18:32 +0000
commitfcd68127a4181c10d86f78625bc3fc7b6a6fcc31 (patch)
tree34c23a65c0edd9ea86de071bffa6ae234be20f4f /gnu
parent865cdfdcf20b336ed7601c8a9c984f3d2f6ecabe (diff)
downloadFreeBSD-src-fcd68127a4181c10d86f78625bc3fc7b6a6fcc31.zip
FreeBSD-src-fcd68127a4181c10d86f78625bc3fc7b6a6fcc31.tar.gz
- 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)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/perl/BSDPAN/BSDPAN.pm12
-rw-r--r--gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm10
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 8b9e3f3..908f03f 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 10dc2d6..4873d30 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}";
OpenPOWER on IntegriCloud