Serguei Trouchelle > CPAN-SQLite-0.202 > CPAN::SQLite::Search

Download:
CPAN-SQLite-0.202.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
Stalled  1
View/Report Bugs
Module Version: 0.202   Source   Latest Release: CPAN-SQLite-0.203

NAME ^

CPAN::SQLite::Search - perform queries on the database

SYNOPSIS ^

  my $max_results = 200;
  my $query = CPAN::SQLite::Search->new(db_dir => $db_dir,
                                        db_name => $db_name,
                                        max_results => $max_results);
  $query->query(mode => 'module', name => 'Net::FTP');
  my $results = $query->{results};

CONSTRUCTING THE QUERY ^

This module queries the database via various types of queries and returns the results for subsequent display. The CPAN::SQLite::Search object is created via the new method as

  my $query = CPAN::SQLite::Search->new(db_dir => $db_dir,
                                        db_name => $db_name,
                                        max_results => $max_results);

which takes as arguments

A basic query then is constructed as

   $query->query(mode => $mode, $type => $value);

with the results available as

   my $results = $query->{results}

There are three basic modes:

module, dist, and author modes

For a mode of module, dist, and author, there are four basic options to be used for the $type => $value option:

RESULTS ^

After making the query, the results can be accessed through

  my $results = $query->{results};

No results either can mean no matches were found, or else an error in making the query resulted (in which case, a brief error message is contained in $query->{error}). Assuming there are results, what is returned depends on the mode and on the type of query. See CPAN::SQLite::Populate for a description of the fields in the various tables listed below - these fields are used as the keys of the hash references that arise.

author mode

module mode

dist mode

SEE ALSO ^

CPAN::SQLite::Populate.

AUTHORS ^

Randy Kobes (passed away on September 18, 2010)

Serguei Trouchelle <stro@cpan.org>

COPYRIGHT ^

Copyright 2006,2008 by Randy Kobes <r.kobes@uwinnipeg.ca>.

Copyright 2011 by Serguei Trouchelle <stro@cpan.org>.

Use and redistribution are under the same terms as Perl itself.

syntax highlighting: