From: Paul Driver Date: Thu, 20 Mar 2008 21:33:59 +0000 (+0000) Subject: Fixed delete() to behave correctly with multiple key arguments. X-Git-Tag: 0.18_01~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1213e927ebf1c78cd7244689f75c236a085abb9;p=gitmo%2FMooseX-AttributeHelpers.git Fixed delete() to behave correctly with multiple key arguments. --- diff --git a/lib/MooseX/AttributeHelpers/MethodProvider/Hash.pm b/lib/MooseX/AttributeHelpers/MethodProvider/Hash.pm index ec8dac5..6e08454 100644 --- a/lib/MooseX/AttributeHelpers/MethodProvider/Hash.pm +++ b/lib/MooseX/AttributeHelpers/MethodProvider/Hash.pm @@ -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;