From: Shawn M Moore Date: Thu, 5 Feb 2009 16:31:39 +0000 (+0000) Subject: Back out the exists($_[1]) change since exists($array[$element]) doesn't X-Git-Tag: 0.19~52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d8b10b3268f3ff4fadb7f7fc2b578a335bcda416;p=gitmo%2FMouse.git Back out the exists($_[1]) change since exists($array[$element]) doesn't work so well for undef in @_ --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index dec1300..9683342 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -75,7 +75,7 @@ sub generate_accessor { my $accessor = "sub {\n"; if ($attribute->_is_metadata eq 'rw') { - $accessor .= 'if (exists $_[1]) {' . "\n"; + $accessor .= 'if (@_ >= 2) {' . "\n"; my $value = '$_[1]';