summaryrefslogtreecommitdiff
path: root/lib/base.pm
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-04-05 22:53:21 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-05 22:31:38 +0000
commit2bc5db750f6eaca35ef355abbc8d4c5aba0531fa (patch)
tree2348f67fcc38c8b3954f6773e4ce98385d90d1a1 /lib/base.pm
parent8aeacb11de2851ebce0d1a967d2ea042973b3d01 (diff)
downloadperl-2bc5db750f6eaca35ef355abbc8d4c5aba0531fa.tar.gz
Fix subtle $VERSION mistakes with base.pm
Message-ID: <20010405215321.A4828@blackrider.blackstar.co.uk> p4raw-id: //depot/perl@9576
Diffstat (limited to 'lib/base.pm')
-rw-r--r--lib/base.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/base.pm b/lib/base.pm
index d055129fb0..8db7d72c25 100644
--- a/lib/base.pm
+++ b/lib/base.pm
@@ -55,7 +55,8 @@ sub import {
foreach my $base (@_) {
next if $pkg->isa($base);
push @{"$pkg\::ISA"}, $base;
- unless (exists ${"$base\::"}{VERSION}) {
+ my $vglob;
+ unless ($vglob = ${"$base\::"}{VERSION} and $vglob{SCALAR}) {
eval "require $base";
# Only ignore "Can't locate" errors from our eval require.
# Other fatal errors (syntax etc) must be reported.
@@ -67,7 +68,7 @@ sub import {
"which defines that package first.)");
}
${"$base\::VERSION"} = "-1, set by base.pm"
- unless exists ${"$base\::"}{VERSION};
+ unless $vglob = ${"$base\::"}{VERSION} and $vglob{SCALAR};
}
# A simple test like (defined %{"$base\::FIELDS"}) will