X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbase.pm;h=4a71c855dbd252fd2e34e0bf4a782c2767f2609d;hb=57451d77f86469523e0ddfb6d70d92f71e056fac;hp=3cb42f5bfa2ffde7b57f4500b06b853462e440f6;hpb=cb50131aab68ac6dda048612c6e853b8cb08701e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/base.pm b/lib/base.pm index 3cb42f5..4a71c85 100644 --- a/lib/base.pm +++ b/lib/base.pm @@ -30,7 +30,7 @@ Cs them. Whether to C a base class package is determined by the absence of a global $VERSION in the base package. If $VERSION is not detected even after loading it, will define $VERSION in the base package, setting it to the string -C<-1, defined by base.pm>. +C<-1, set by base.pm>. =head1 HISTORY @@ -45,7 +45,7 @@ L package base; use 5.005_64; -our $VERSION = "1.01"; +our $VERSION = "1.02"; sub import { my $class = shift; @@ -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 (${*{"$base\::VERSION"}{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 ${*{"$base\::VERSION"}{SCALAR}}; } # A simple test like (defined %{"$base\::FIELDS"}) will