X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FAccessor%2FNative%2FArray%2Ffirst.pm;h=88c1f4452664e083edf7c87b18d84024ae7275ef;hb=88e88a7b2cfdf5d777f502a34cfbf5ba69809c58;hp=7323bb76551b3f6812a5011bbc28e645a743d902;hpb=173cb840274371035569e437289a8d2cef1a984b;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm index 7323bb7..88c1f44 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/first.pm @@ -4,6 +4,7 @@ use strict; use warnings; use List::Util (); +use Params::Util (); our $VERSION = '1.14'; $VERSION = eval $VERSION; @@ -30,7 +31,7 @@ sub _inline_check_arguments { return $self->_inline_throw_error( q{'The argument passed to first must be a code reference'}) - . q{if $_[0] && ( ref $_[0] || q{} ) ne 'CODE';}; + . q{ unless Params::Util::_CODELIKE( $_[0] );}; } sub _return_value {