burninate documentation for DOM::Tiny
[catagits/DOM-Tiny.git] / lib / DOM / Tiny / _Collection.pm
index 44a1741..547946c 100644 (file)
@@ -8,7 +8,7 @@ use Scalar::Util 'blessed';
 
 use constant REDUCE => ($] >= 5.008009 ? \&List::Util::reduce : \&_reduce);
 
-our $VERSION = '0.002';
+our $VERSION = '0.004';
 
 sub new {
   my $class = shift;
@@ -116,16 +116,15 @@ sub _reduce (&@) {
 
   no strict 'refs';
 
-  local(*{$caller."::a"}) = \my $a;
-  local(*{$caller."::b"}) = \my $b;
+  local (*{"${caller}::a"}, *{"${caller}::b"}) = (\my $x, \my $y);
 
-  $a = shift;
-  foreach (@_) {
-    $b = $_;
-    $a = &{$code}();
+  $x = shift;
+  foreach my $e (@_) {
+    $y = $e;
+    $x = $code->();
   }
 
-  $a;
+  $x;
 }
 
 sub _ref { ref $_[0] eq 'ARRAY' || blessed $_[0] && $_[0]->isa(__PACKAGE__) }