From: Dagfinn Ilmari Mannsåker Date: Mon, 12 Nov 2012 10:42:14 +0000 (+0000) Subject: don't use $_ as loop variable when calling arbitrary code X-Git-Tag: v1.002005~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FRole-Tiny.git;a=commitdiff_plain;h=667f4e70c519db70d01331d4fe4c33d94740e60a don't use $_ as loop variable when calling arbitrary code --- diff --git a/Changes b/Changes index cf47c19..138d373 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - don't use $_ as loop variable when calling arbitrary code + 1.002004 - 2012-11-02 - remove accidentally-introduced strictures.pm usage diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 5877150..9a3ce29 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -190,14 +190,18 @@ sub apply_roles_to_package { delete $INFO{$to}{methods}; # reset since we're about to add methods } - $me->apply_role_to_package($to, $_) for @roles; + foreach my $role (@roles) { + $me->apply_single_role_to_package($to, $role); + } $APPLIED_TO{$to}{join('|',@roles)} = 1; } sub _composite_info_for { my ($me, @roles) = @_; $COMPOSITE_INFO{join('|', sort @roles)} ||= do { - _load_module($_) for @roles; + foreach my $role (@roles) { + _load_module($role); + } my %methods; foreach my $role (@roles) { my $this_methods = $me->_concrete_methods_of($role);