sub import {
my $target = caller;
- my $me = $_[0];
+ my $me = shift;
strictures->import;
return if $INFO{$target}; # already exported into this package
# get symbol table reference
}
1;
+__END__
=head1 NAME
package Some::Class;
- require Role::Tiny;
+ use Role::Tiny::With;
# bar gets imported, but not foo
- Role::Tiny->apply_role_to_package('Some::Role', __PACKAGE__);
+ with 'Some::Role';
sub foo { ... }
Role::Tiny->apply_role_to_package('Some::Package', 'Some::Role');
-Composes role with package
+Composes role with package. See also L<Role::Tiny::With>.
=head2 apply_roles_to_object