X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbase.pm;h=be4c667e674f60f31a3a5d4d0f98a1dfb1fe413c;hb=d81018543234fe5f8d429eb7048c0b50792ea031;hp=9649e8aa9a8336e3d3a948c51ad7f1620bd256ca;hpb=6df974e5cec9080f83fec3cb22f1c756d1aa4628;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/base.pm b/lib/base.pm index 9649e8a..be4c667 100644 --- a/lib/base.pm +++ b/lib/base.pm @@ -71,12 +71,13 @@ sub import { my $inheritor = caller(0); my @isa_classes; + my @bases; foreach my $base (@_) { if ( $inheritor eq $base ) { warn "Class '$inheritor' tried to inherit from itself\n"; } - next if $inheritor->isa($base); + next if grep $_->isa($base), ($inheritor, @bases); if (has_version($base)) { ${$base.'::VERSION'} = '-1, set by base.pm' @@ -92,19 +93,21 @@ sub import { die if $@ && $@ !~ /^Can't locate .*? at \(eval /; unless (%{"$base\::"}) { require Carp; + local $" = " "; Carp::croak(<