From: Dan Book Date: Sun, 22 Nov 2015 22:18:59 +0000 (-0500) Subject: the lexicals in the reduce fallback don't actually need to be called $a and $b X-Git-Tag: v0.003~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FDOM-Tiny.git;a=commitdiff_plain;h=aeae951287c7fa77c0ce5acb7e83b8199ab87862 the lexicals in the reduce fallback don't actually need to be called $a and $b --- diff --git a/lib/DOM/Tiny/_Collection.pm b/lib/DOM/Tiny/_Collection.pm index 24ec8b7..1046bd7 100644 --- a/lib/DOM/Tiny/_Collection.pm +++ b/lib/DOM/Tiny/_Collection.pm @@ -116,16 +116,16 @@ sub _reduce (&@) { no strict 'refs'; - local(*{$caller."::a"}) = \my $a; - local(*{$caller."::b"}) = \my $b; + local(*{$caller."::a"}) = \my $x; + local(*{$caller."::b"}) = \my $y; - $a = shift; + $x = shift; foreach (@_) { - $b = $_; - $a = &{$code}(); + $y = $_; + $x = $code->(); } - $a; + $x; } sub _ref { ref $_[0] eq 'ARRAY' || blessed $_[0] && $_[0]->isa(__PACKAGE__) }