X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FAbstract.pm;h=a778174e8ffb1395192f601c4e5607156f2efab5;hb=7c840ffde1b169f76dbe4cf8c01af235eee5a787;hp=50627e893cc655a2ee445f48c6ad4166d709dea8;hpb=82590c73cd001ba13fbf6f9720efb6d07b8acaa3;p=dbsrgits%2FSQL-Abstract.git diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 50627e8..a778174 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -702,13 +702,12 @@ sub _expand_expr_hashpair_scalar { sub _expand_expr_hashpair_op { my ($self, $k, $v) = @_; - my $op = $k; - $op =~ s/^-// if length($op) > 1; + s/^-(?=\w)//, s/ +/_/g for my $op = lc $k; $self->_assert_pass_injection_guard($op); # Ops prefixed with -not_ get converted - if (my ($rest) = $op =~/^not[_ ](.*)$/) { + if (my ($rest) = $op =~/^not_(.*)$/) { return +{ -op => [ 'not', $self->_expand_expr({ "-${rest}", $v }) @@ -718,6 +717,8 @@ sub _expand_expr_hashpair_op { { # Old SQLA compat + my $op = join(' ', split '_', $op); + # the old special op system requires illegality for top-level use if (