[Rt-commit] r5620 - Scalar-Defer/lib/Scalar

audreyt at bestpractical.com audreyt at bestpractical.com
Wed Jul 19 21:04:14 EDT 2006


Author: audreyt
Date: Wed Jul 19 21:04:14 2006
New Revision: 5620

Modified:
   Scalar-Defer/lib/Scalar/Defer.pm

Log:
* Comment and syntax cleanup.

Modified: Scalar-Defer/lib/Scalar/Defer.pm
==============================================================================
--- Scalar-Defer/lib/Scalar/Defer.pm	(original)
+++ Scalar-Defer/lib/Scalar/Defer.pm	Wed Jul 19 21:04:14 2006
@@ -12,9 +12,12 @@
 private _defer => my %_defer;
 
 BEGIN {
-    overload::OVERLOAD( 0 => fallback => 1, map {
-        $_ => sub { &{$_defer{ Class::InsideOut::id $_[0] }} }
-    } qw( bool "" 0+ ${} @{} %{} &{} *{} ));
+    # Set up overload for the package "0".
+    overload::OVERLOAD(
+        '0' => fallback => 1, map {
+            $_ => sub { &{$_defer{ id $_[0] }} }
+        } qw( bool "" 0+ ${} @{} %{} &{} *{} )
+    );
 
     no strict 'refs';
     *{"0::AUTOLOAD"} = sub {
@@ -24,13 +27,13 @@
             $meth = substr($meth, $idx + 2);
         }
 
-        unshift @_, force(shift());
+        unshift @_, force(shift(@_));
         goto &{$_[0]->can($meth)};
     };
 
     foreach my $sym (keys %UNIVERSAL::) {
         *{"0::$sym"} = sub {
-            unshift @_, force(shift());
+            unshift @_, force(shift(@_));
             goto &{$_[0]->can($sym)};
         };
     }


More information about the Rt-commit mailing list