From: Matt S Trout Date: Sun, 14 Nov 2010 19:50:52 +0000 (+0000) Subject: move _getglob def above strict for elegance X-Git-Tag: 0.009001~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=119014a7b7f62d9f9f1b7edce27fc19d2146f614;p=gitmo%2FRole-Tiny.git move _getglob def above strict for elegance --- diff --git a/lib/Moo/_Utils.pm b/lib/Moo/_Utils.pm index 6bf8f22..82ecfcb 100644 --- a/lib/Moo/_Utils.pm +++ b/lib/Moo/_Utils.pm @@ -1,12 +1,12 @@ package Moo::_Utils; +sub _getglob { \*{$_[0]} } + use strictures 1; use base qw(Exporter); our @EXPORT = qw(_getglob _install_modifier _load_module _maybe_load_module); -sub _getglob { no strict 'refs'; \*{$_[0]} } - sub _install_modifier { my ($into, $type, $name, $code) = @_; diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index bcaa374..669d0a3 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -1,5 +1,7 @@ package Role::Tiny; +sub _getglob { \*{$_[0]} } + use strict; use warnings FATAL => 'all'; @@ -7,8 +9,6 @@ our %INFO; our %APPLIED_TO; our %COMPOSED; -sub _getglob { no strict 'refs'; \*{$_[0]} } - sub _load_module { return 1 if $_[0]->can('can'); (my $proto = $_[0]) =~ s/::/\//g;