DDC::Any - abstract wrapper for DDC::XS or DDC::PP
##===================================================================== ## Preliminaries use DDC::Any; ##-- use DDC::XS if available, otherwise DDC::PP use DDC::Any ':xs'; ##-- force DDC::XS back-end use DDC::Any ':pp'; ##-- force DDC::PP back-end use DDC::Any ':none'; ##-- don't load or bind a back-end yet (call import() yourself later) ##===================================================================== ## Package Variables my $which = $DDC::Any::WHICH; ##-- either 'DDC::XS' or 'DDC::PP' ##===================================================================== ## Usage ## ... address any DDC::(XS|PP)::* thingy as DDC::Any::* my $query = DDC::Any->parse("foo && bar && !baz"); print $query->toStringFull(); print $query->isa('DDC::Any::CQuery') ? "yup\n" : "nope\n";
This module provides a unified API for parsing and manipulation of DDC search engine queries, using either DDC::XS or DDC::PP as a back-end. Using this package will walk the symbol table of the selected back-end namespace and recursively map variables, methods, and sub-packages to the DDC::Any namespace, thus the class DDC::Any::CQToken will be mapped to either DDC::XS::CQToken or DDC::PP::CQToken, depending on the back-end. Additionally, back-end subpackages will be modified to inherit from the associated DDC::Any subpackage, so that that you can generically test for inheritance using for exanple UNIVERSAL::isa($query,'DDC::Any::CQToken') on a $query object of an appropriate back-end type. You can specify either :xs or :pp in the argument-list to use (rsp. DDC::Any->import()) in order to force use of a particular back-end.
DDC::Any
DDC::Any::CQToken
DDC::XS::CQToken
DDC::PP::CQToken
UNIVERSAL::isa($query,'DDC::Any::CQToken')
$query
:xs
:pp
use
DDC::Any->import()
perl by Larry Wall.
DDC originally by Alexey Sokirko.
Bryan Jurish <moocow@cpan.org>
Copyright (c) 2016, Bryan Jurish. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
perl(1), DDC::XS(3perl), DDC::PP(3perl)
To install DDC::Concordance, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DDC::Concordance
CPAN shell
perl -MCPAN -e shell install DDC::Concordance
For more information on module installation, please visit the detailed CPAN module installation guide.