};
# grab all *non-constant* (stash slot is not a scalarref) subs present
# in the symbol table and store their refaddrs (no need to forcibly
- # inflate constant subs into real subs) - also add '' to here (this
- # is used later) with a map to the coderefs in case of copying or re-use
- my @not_methods = ('', map { *$_{CODE}||() } grep !ref($_), values %$stash);
+ # inflate constant subs into real subs) with a map to the coderefs in
+ # case of copying or re-use
+ my @not_methods = (map { *$_{CODE}||() } grep !ref($_), values %$stash);
@{$INFO{$target}{not_methods}={}}{@not_methods} = @not_methods;
# a role does itself
$APPLIED_TO{$target} = { $target => undef };
# grab all code entries that aren't in the not_methods list
map {
my $code = *{$stash->{$_}}{CODE};
- # rely on the '' key we added in import for "no code here"
- exists $not_methods->{$code||''} ? () : ($_ => $code)
+ ( ! $code or exists $not_methods->{$code} ) ? () : ($_ => $code)
} grep !ref($stash->{$_}), keys %$stash
};
}
1;
+=encoding utf-8
+
=head1 NAME
Role::Tiny - Roles. Like a nouvelle cuisine portion size slice of Moose.
Additionally, Role::Tiny will override the standard Perl C<DOES> method
for your class. However, if C<any> class in your class' inheritance
-heirarchy provides C<DOES>, then Role::Tiny will not override it.
+hierarchy provides C<DOES>, then Role::Tiny will not override it.
=head1 METHODS