1 package Data::Query::ExprBuilder;
4 use Data::Query::Constants qw(DQ_OPERATOR DQ_VALUE);
10 my ($overload, $as) = ref($_) ? @$_ : ($_, $_);
12 Data::Query::ExprBuilder->new({
15 operator => { perl => $as },
18 (Scalar::Util::blessed($_)
19 && $_->isa('Data::Query::ExprBuilder'))
23 subtype => { perl => 'Scalar' },
26 } $_[2] ? @_[1,0] : @_[0,1]
32 qw(+ - * / % ** << >> . < > == != lt le gt ge eq ne),
34 # since 'and' and 'or' aren't operators we borrow the bitwise ops
35 [ '&' => 'and' ], [ '|' => 'or' ],
40 $op => sub { die "Can't use operator $op on a ".ref($_[0]) }
46 bless({ %{$_[1]} }, (ref($_[0])||$_[0]));