From: Matt S Trout Date: Sat, 11 Feb 2012 22:56:01 +0000 (+0000) Subject: additional local $\@ removals X-Git-Tag: v0.009014~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7568ba55848e41dec5a2a6d04f9abab95dcb5fa3;p=gitmo%2FMoo.git additional local $\@ removals --- diff --git a/lib/Method/Generate/Constructor.pm b/lib/Method/Generate/Constructor.pm index 95cbe88..33e6a08 100644 --- a/lib/Method/Generate/Constructor.pm +++ b/lib/Method/Generate/Constructor.pm @@ -62,7 +62,7 @@ sub generate_method { } $body .= ' return $new;'."\n"; if ($into->can('DEMOLISH')) { - { local $@; require Method::Generate::DemolishAll; } + require Method::Generate::DemolishAll; Method::Generate::DemolishAll->new->generate_method($into); } quote_sub diff --git a/lib/Moo/Object.pm b/lib/Moo/Object.pm index 04d7f7e..9968382 100644 --- a/lib/Moo/Object.pm +++ b/lib/Moo/Object.pm @@ -12,7 +12,7 @@ sub new { unless (exists $NO_DEMOLISH{$class}) { unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) { ($DEMOLISH_MAKER ||= do { - { local $@; require Method::Generate::DemolishAll; } + require Method::Generate::DemolishAll; Method::Generate::DemolishAll->new })->generate_method($class); } @@ -50,7 +50,7 @@ sub BUILDARGS { sub BUILDALL { my $self = shift; $self->${\(($BUILD_MAKER ||= do { - { local $@; require Method::Generate::BuildAll; } + require Method::Generate::BuildAll; Method::Generate::BuildAll->new })->generate_method(ref($self)))}(@_); } @@ -58,13 +58,13 @@ sub BUILDALL { sub DEMOLISHALL { my $self = shift; $self->${\(($DEMOLISH_MAKER ||= do { - { local $@; require Method::Generate::DemolishAll; } + require Method::Generate::DemolishAll; Method::Generate::DemolishAll->new })->generate_method(ref($self)))}(@_); } sub does { - { local $@; require Role::Tiny; } + require Role::Tiny; { no warnings 'redefine'; *does = \&Role::Tiny::does_role } goto &Role::Tiny::does_role; } diff --git a/lib/Moo/_Utils.pm b/lib/Moo/_Utils.pm index 5f5e51f..6b585cf 100644 --- a/lib/Moo/_Utils.pm +++ b/lib/Moo/_Utils.pm @@ -23,7 +23,7 @@ sub _install_modifier { my ($into, $type, $name, $code) = @_; if (my $to_modify = $into->can($name)) { # CMM will throw for us if not - { local $@; require Sub::Defer; } + require Sub::Defer; Sub::Defer::undefer_sub($to_modify); } diff --git a/lib/Moo/_mro.pm b/lib/Moo/_mro.pm index 1cfa949..e599045 100644 --- a/lib/Moo/_mro.pm +++ b/lib/Moo/_mro.pm @@ -1,7 +1,5 @@ package Moo::_mro; -local $@; - if ($] >= 5.010) { require mro; } else { diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index e9d8b73..623b338 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -18,7 +18,7 @@ sub _load_module { # can't just ->can('can') because a sub-package Foo::Bar::Baz # creates a 'Baz::' key in Foo::Bar's symbol table return 1 if grep !/::$/, keys %{_getstash($_[0])||{}}; - { local $@; require "${proto}.pm"; } + require "${proto}.pm"; return 1; } @@ -32,7 +32,7 @@ sub import { # install before/after/around subs foreach my $type (qw(before after around)) { *{_getglob "${target}::${type}"} = sub { - { local $@; require Class::Method::Modifiers; } + require Class::Method::Modifiers; push @{$INFO{$target}{modifiers}||=[]}, [ $type => @_ ]; }; } @@ -102,9 +102,9 @@ sub create_class_with_roles { } if ($] >= 5.010) { - { local $@; require mro; } + require mro; } else { - { local $@; require MRO::Compat; } + require MRO::Compat; } my @composable = map $me->_composable_package_for($_), reverse @roles;