From: Matt S Trout Date: Wed, 9 May 2012 18:01:41 +0000 (+0000) Subject: return; from with/etc. X-Git-Tag: v0.091005~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d49ee2792c487353cae59f59cde2e5aaba6d545;p=gitmo%2FMoo.git return; from with/etc. --- diff --git a/Changes b/Changes index 5c8f676..b2c2c13 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ + - add an explicit return to all exported subs so people don't accidentally + rely on the return value + 0.091004 - 2012-05-07 - also inhale from Mouse - clarify how isa and coerce interact diff --git a/lib/Moo.pm b/lib/Moo.pm index f172159..3af5e7c 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -30,6 +30,7 @@ sub import { grep defined, map Mouse::Util::find_meta($_), @_ ] if $INC{"Mouse.pm"}; $class->_maybe_reset_handlemoose($target); + return; }; _install_coderef "${target}::with" => "Moo::with" => sub { require Moo::Role; @@ -44,11 +45,13 @@ sub import { $class->_accessor_maker_for($target) ->generate_method($target, $name, \%spec); $class->_maybe_reset_handlemoose($target); + return; }; foreach my $type (qw(before after around)) { _install_coderef "${target}::${type}" => "Moo::${type}" => sub { require Class::Method::Modifiers; _install_modifier($target, $type, @_); + return; }; } {