X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FRole%2FTiny.pm;h=6af899ffadb61dd75ef637150661fcefb13f9f3e;hb=faa9ce11cefee1e6f7800ec1dbe561717c162161;hp=447901261b9b6612bbafb9fef8a811f1b25a25ce;hpb=7b8177f835014e871d1c75016272ba320f4cd975;p=gitmo%2FRole-Tiny.git diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 4479012..6af899f 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -53,7 +53,7 @@ sub import { # inflate constant subs into real subs) - also add '' to here (this # is used later) @{$INFO{$target}{not_methods}={}}{ - '', map { *$_{CODE}||() } grep !_is_scalar_ref($_), values %$stash + '', map { *$_{CODE}||() } grep !ref($_), values %$stash } = (); # a role does itself $APPLIED_TO{$target} = { $target => undef }; @@ -182,7 +182,7 @@ sub _concrete_methods_of { my $code = *{$stash->{$_}}{CODE}; # rely on the '' key we added in import for "no code here" exists $not_methods->{$code||''} ? () : ($_ => $code) - } grep !_is_scalar_ref($stash->{$_}), keys %$stash + } grep !ref($stash->{$_}), keys %$stash }; }; } @@ -206,7 +206,7 @@ sub _install_methods { # determine already extant methods of target my %has_methods; @has_methods{grep - +(_is_scalar_ref($stash->{$_}) || *{$stash->{$_}}{CODE}), + +(ref($stash->{$_}) || *{$stash->{$_}}{CODE}), keys %$stash } = ();