From: Matt S Trout Date: Wed, 9 May 2012 18:01:22 +0000 (+0000) Subject: return; from with/etc. X-Git-Tag: v1.001003~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef2da7113f32425de85dbefe3344b9077c0a0501;p=gitmo%2FRole-Tiny.git return; from with/etc. --- diff --git a/Changes b/Changes index 4791c21..5ec7afb 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - add an explicit return to all exported subs so people don't accidentally + rely on the return value - store coderefs as well as their refaddrs to protect against crazy 1.001002 - 2012-05-05 diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index cd32786..7f8c7fb 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -51,13 +51,16 @@ sub import { *{_getglob "${target}::${type}"} = sub { require Class::Method::Modifiers; push @{$INFO{$target}{modifiers}||=[]}, [ $type => @_ ]; + return; }; } *{_getglob "${target}::requires"} = sub { push @{$INFO{$target}{requires}||=[]}, @_; + return; }; *{_getglob "${target}::with"} = sub { $me->apply_roles_to_package($target, @_); + return; }; # grab all *non-constant* (stash slot is not a scalarref) subs present # in the symbol table and store their refaddrs (no need to forcibly