}
}
-my %loaded; # track modules loaded via base.pm
-
sub import {
my $class = shift;
next if grep $_->isa($base), ($inheritor, @bases);
- if (! $loaded{$base}) {
+ # Following blocks help isolate $SIG{__DIE__} changes
+ {
my $sigdie;
{
local $SIG{__DIE__};
}
# Make sure a global $SIG{__DIE__} makes it out of the localization.
$SIG{__DIE__} = $sigdie if defined $sigdie;
- $loaded{$base}++;
}
push @bases, $base;
There is no F<Foo.pm>, but because C<Foo> defines a symbol (the C<exclaim>
subroutine), C<base> will not die when the C<require> fails to load F<Foo.pm>.
-C<base> keeps track of modules that were successfully used as a base and will
-not C<require> them again.
C<base> will also initialize the fields if one of the base classes has it.
Multiple inheritance of fields is B<NOT> supported, if two or more base classes