diff options
author | Andreas König <a.koenig@mind.de> | 2002-05-08 17:57:53 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-08 12:57:32 +0000 |
commit | b94834e7ae8798fd802ec459d4401f55ab151f05 (patch) | |
tree | 5f6510c962a73ab55ba638b5f83705b38455007c /lib/base.pm | |
parent | e5e32a3af68bad2724c5ecf673fa0e8a34a4fe13 (diff) | |
download | perl-b94834e7ae8798fd802ec459d4401f55ab151f05.tar.gz |
Re: [PATCH] use base Notexists
Message-ID: <m34rhi91y6.fsf@anima.de>
p4raw-id: //depot/perl@16484
Diffstat (limited to 'lib/base.pm')
-rw-r--r-- | lib/base.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/base.pm b/lib/base.pm index c6d8cca4a7..37f220f63a 100644 --- a/lib/base.pm +++ b/lib/base.pm @@ -45,7 +45,7 @@ L<fields> package base; use 5.006_001; -our $VERSION = "1.02"; +our $VERSION = "1.03"; sub import { my $class = shift; @@ -54,9 +54,10 @@ sub import { foreach my $base (@_) { next if $pkg->isa($base); - push @{"$pkg\::ISA"}, $base; my $vglob; - unless (${*{"$base\::VERSION"}{SCALAR}}) { + if ($vglob = ${"$base\::"}{VERSION} and *$vglob{SCALAR}) { + $$vglob = "-1, set by base.pm" unless defined $$vglob; + } else { eval "require $base"; # Only ignore "Can't locate" errors from our eval require. # Other fatal errors (syntax etc) must be reported. @@ -67,9 +68,9 @@ sub import { "\t(Perhaps you need to 'use' the module ", "which defines that package first.)"); } - ${"$base\::VERSION"} = "-1, set by base.pm" - unless ${*{"$base\::VERSION"}{SCALAR}}; + ${"$base\::VERSION"} = "-1, set by base.pm" unless defined ${"$base\::VERSION"}; } + push @{"$pkg\::ISA"}, $base; # A simple test like (defined %{"$base\::FIELDS"}) will # sometimes produce typo warnings because it would create |