Fixed delete() to behave correctly with multiple key arguments.
Paul Driver [Thu, 20 Mar 2008 21:33:59 +0000 (21:33 +0000)]
lib/MooseX/AttributeHelpers/MethodProvider/Hash.pm

index ec8dac5..6e08454 100644 (file)
@@ -56,7 +56,10 @@ sub clear : method {
 
 sub delete : method {
     my ($attr, $reader, $writer) = @_;
-    return sub { CORE::delete $reader->($_[0])->{$_[1]} };
+    return sub { 
+        my $hashref = $reader->(shift);
+        CORE::delete @{$hashref}{@_};
+    };
 }
 
 1;