PAR::Repository::Query - Implements repository queries
use PAR::Repository; # or: use PAR::Repository::Client;
This module is for internal use by PAR::Repository or PAR::Repository::Client only. Both modules inherit from this. PAR::Repository::Query implements a unified query interface for both the server- and client-side components of PAR repositories.
PAR::Repository::Query
If you decide to inherit from this class (for whatever reason), you should provide at least two methods: modules_dbm which returns a DBM::Deep object representing the modules DBM file. (See PAR::Repository::DBM for details.) And scripts_dbm which is the equivalent for the scripts DBM file.
modules_dbm
scripts_dbm
None. But the methods are callable on PAR::Repository and PAR::Repository::Client objects.
PAR::Repository
PAR::Repository::Client
Following is a list of class and instance methods. (Instance methods until otherwise mentioned.)
There is no PAR::Repository::Query object.
Polls the repository for modules matching certain criteria. Takes named arguments. Either a regex or a name parameter must be present but not both.
regex
name
Returns a reference to an array containing alternating distribution file names and module versions. This method returns the following structure
[ 'Foo-Bar-0.01-any_arch-5.8.7.par', '0.01', ... ]
that means the module was found in the distribution Foo-Bar-0.01-any_arch-5.8.7.par and the copy in that file has version 0.01.
Parameters:
The name of the module to look for. This is used for an exact match. If you want to find Foo in Foo::Bar, use the regex parameter. Only one of name and regex may be specified.
Foo
Foo::Bar
Same as name, but interpreted as a regular expression. Only one of name and regex may be specified.
Can be used to reduce the number of matches to a specific architecture. Always interpreted as a regular expression.
Note: Usually, you probably want to use query_script_hash() instead. The usage of both methods is very similar (and described right below), but the data structure returned differes somewhat.
query_script_hash()
Polls the repository for scripts matching certain criteria. Takes named arguments. Either a regex or a name parameter must be present but not both.
Returns a reference to an array containing alternating distribution file names and script versions. This method returns the following structure
that means the script was found in the distribution Foo-Bar-0.01-any_arch-5.8.7.par and the copy in that file has version 0.01.
The name of the script to look for. This is used for an exact match. If you want to find foo in foobar, use the regex parameter. Only one of name and regex may be specified.
foo
foobar
Works exactly the same as query_script except it returns a different resulting structure which includes the matching script's name:
query_script
{ 'fooscript' => { 'Foo-Bar-0.01-any_arch-5.8.7.par' => '0.01', ... }, ... }
that means the script fooscript was found in the distribution Foo-Bar-0.01-any_arch-5.8.7.par and the copy in that file has version 0.01.
fooscript
Parameters are the same as for query_script
Polls the repository for distributions matching certain criteria. Takes named arguments. Either a regex or a name parameter must be present but not both.
Returns a reference to an array containing alternating distribution file names and hash references. The hashes contain module names and associated versions in the distribution. This method returns the following structure
[ 'Foo-Bar-0.01-any_arch-5.8.7.par', {Foo::Bar => '0.01', Foo::Bar::Baz => '0.02'}, ... ]
that means the distribution Foo-Bar-0.01-any_arch-5.8.7.par matched and that distribution contains the modules Foo::Bar and Foo::Bar::Baz with versions 0.01 and 0.02 respectively.
Foo::Bar::Baz
The name of the distribution to look for. This is used for an exact match. If you want to find Foo in Foo-Bar-0.01-any_arch-5.8.8.par, use the regex parameter. Only one of name and regex may be specified.
Foo-Bar-0.01-any_arch-5.8.8.par
Steffen Müller, <smueller@cpan.org>
Copyright (C) 2006-2009 by Steffen Müller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Müller,'. Assuming UTF-8
To install PAR::Repository::Query, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PAR::Repository::Query
CPAN shell
perl -MCPAN -e shell install PAR::Repository::Query
For more information on module installation, please visit the detailed CPAN module installation guide.