From: Peter Rabbitson Date: Sat, 28 Mar 2009 02:00:46 +0000 (+0000) Subject: Warn about deprecation of and/or/nestX X-Git-Tag: v1.70~190 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6dae476e965f178f2226835dbbdae8f6558f5181;p=dbsrgits%2FSQL-Abstract.git Warn about deprecation of and/or/nestX --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6437528..65b5011 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -442,11 +442,17 @@ sub _where_HASHREF { sub _where_op_in_hash { - my ($self, $op, $v) = @_; + my ($self, $op_str, $v) = @_; + + $op_str =~ /^ (AND|OR|NEST) ( \_? \d* ) $/xi + or puke "unknown operator: -$op_str"; + + my $op = uc($1); # uppercase, remove trailing digits + if ($2) { + belch 'Use of [and|or|nest]_N modifiers is deprecated and will be removed in SQLA v2.0. ' + . "You probably wanted ...-and => [ $op_str => COND1, $op_str => COND2 ... ]"; + } - $op =~ /^(AND|OR|NEST)[_\d]*/i - or puke "unknown operator: -$op"; - $op = uc($1); # uppercase, remove trailing digits $self->_debug("OP(-$op) within hashref, recursing..."); $self->_SWITCH_refkind($v, {