for my $col ( grep { $_ !~ /^\-/ } keys %$fin ) {
next unless ref $fin->{$col} eq 'ARRAY' and ($fin->{$col}[0]||'') =~ /^\-and$/i;
my $val_bag = { map {
- (! defined $_ ) ? ( UNDEF => undef )
- : ( ! ref $_ or is_plain_value $_ ) ? ( "VAL_$_" => $_ )
+ (! defined $_ ) ? ( UNDEF => undef )
+ : ( ! length ref $_ or is_plain_value $_ ) ? ( "VAL_$_" => $_ )
: ( ( 'SER_' . serialize $_ ) => $_ )
} @{$fin->{$col}}[1 .. $#{$fin->{$col}}] };
push @conds, { $lhs => $rhs };
}
}
+ # unroll func + { -value => ... }
+ elsif (
+ ref $rhs eq 'HASH'
+ and
+ ( my ($subop) = keys %$rhs ) == 1
+ and
+ length ref ((values %$rhs)[0])
+ and
+ my $vref = is_plain_value( (values %$rhs)[0] )
+ ) {
+ push @conds, { $lhs => { $subop => $$vref } }
+ }
else {
push @conds, { $lhs => $rhs };
}