From: Matt S Trout Date: Wed, 9 Oct 2013 18:18:17 +0000 (+0000) Subject: only default in $_ if @_ is empty, not if $_[0] exists but is undef X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dae067a8b3d42247f2ea6c76d4ae8e177835dab0;p=dbsrgits%2FData-Query.git only default in $_ if @_ is empty, not if $_[0] exists but is undef --- diff --git a/lib/Data/Query/ExprHelpers.pm b/lib/Data/Query/ExprHelpers.pm index 399a8e2..b6df568 100644 --- a/lib/Data/Query/ExprHelpers.pm +++ b/lib/Data/Query/ExprHelpers.pm @@ -72,7 +72,7 @@ foreach my $name (values %Data::Query::Constants::CONST) { no strict 'refs'; my $sub = "is_${name}"; *$sub = sub { - my $dq = $_[0]||$_; + my $dq = @_ ? $_[0] : $_; $dq->{type} and $dq->{type} eq $name }; push @EXPORT, $sub;