}
$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
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);
}
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)))}(@_);
}
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;
}
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);
}
package Moo::_mro;
-local $@;
-
if ($] >= 5.010) {
require mro;
} else {
# 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;
}
# 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 => @_ ];
};
}
}
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;