DB::Object::Expression - Expression Object
my $op = $dbh->ANY( 1, 2, 3 ); # will produce: ANY ( 1, 2, 3 ) "'something'" == $dbh->ALL( qw( some other words ) ); "'something'" == $dbh->ANY( qw( some other words ) ); "'something'" == $dbh->IN( qw( some other words ) ); # 'something' ANY ( some, other, words ); "something" != $dbh->ANY( qw( some other words ) ); # 'something' NOT ANY ( some, other, words );
This is a class to represent an expression and is fairly simple, and designed to be recognised and processed accordingly when building SQL statements, such as in WHERE clauses.
WHERE
DB::Object::Expression are instantiated when operators like ALL, ANY or IN are subject to overloading. such as demonstrated in the SYNOPSIS
DB::Object::Expression
ALL
ANY
IN
Takes a list of values that are saved in the newly created object returned.
Returns a space separated list of values embedded in the object.
For example:
"'something'" == $dbh->ANY( qw( some other words ) ); # 'something' ANY ( some, other, words );
In list context, returns an array of those values passed to "new" and in scalar context, it returns those value as array reference.
Objects for this class calls "as_string" when they need to be stringified.
DB::Object::ALL, DB::Object::ANY, DB::Object::IN
Jacques Deguest <jack@deguest.jp>
Copyright (c) 2023 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install DB::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::Object
CPAN shell
perl -MCPAN -e shell install DB::Object
For more information on module installation, please visit the detailed CPAN module installation guide.