sub apply_single_role_to_package {
my ($me, $to, $role) = @_;
+ return if our $SKIP_APPLY;
_load_module($role);
$me->$step($to, $role);
}
}
+ # backcompat: allow subclasses to use apply_single_role_to_package
+ # to apply changes. set a local var so ours does nothing.
+ local our $SKIP_APPLY = 1;
+ foreach my $role (@roles) {
+ $me->apply_single_role_to_package($to, $role);
+ }
$APPLIED_TO{$to}{join('|',@roles)} = 1;
}