CPAN::SQLite

CPAN::SQLite is a Perl module that allows you to maintain and search a minimal CPAN database.
Download

CPAN::SQLite Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Randy Kobes
  • Publisher web site:
  • http://search.cpan.org/~rkobes/

CPAN::SQLite Tags


CPAN::SQLite Description

CPAN::SQLite is a Perl module that allows you to maintain and search a minimal CPAN database. CPAN::SQLite is a Perl module that allows you to maintain and search a minimal CPAN database.SYNOPSIS my $obj = CPAN::SQLite->new(CPAN => '/path/to/CPAN'); $obj->index(setup => 1); $obj->query(mode => 'dist', name => 'CPAN'); my $results = $obj->{results};This package is used for setting up, maintaining, and searching a CPAN database consisting of the information stored in the three main CPAN indices: $CPAN/modules/03modlist.data.gz, $CPAN/modules/02packages.details.txt.gz, and $CPAN/authors/01mailrc.txt.gz. It should be considered at an alpha stage of development.One begins by creating the object as my $obj = CPAN::SQLite->new(%args);which accepts the following arguments: * CPAN => '/path/to/CPAN' This specifies the path to where the index files are to be stored. This could be a local CPAN mirror, defined here by the presence of a MIRRORED.BY file beneath this directory, or a local directory in which to store these files from a remote CPAN mirror. In the latter case, the index files are fetched from a remote CPAN mirror, using the same list that CPAN.pm uses, if this is configured, and are updated if they are more than one day old. If the CPAN option is not given, it will default to cpan_home of CPAN, if this is configured, with the index files found under keep_source_where. A fatal error results if such a directory isn't found. Updates to these index files are assumed here to be handled by CPAN.pm. * db_dir => '/path/to/db/dir' This specifies the path to where the database file is found. If not given, it defaults to the cpan_home directory of CPAN.pm, if present, or to the directory in which the script was invoked. The name of the database file is cpandb.sql.There are two main methods available.$obj->index(%args);This is used to set up and maintain the database. The following arguments are accepted: * setup => 1 This specifies that the database is to be created and populated from the CPAN indices; any exisiting database will be overwritten. Not specifying this option will assume that an existing database is to be updated. * reindex => 'dist_name' This specifies that the CPAN distribution dist_name is to be reindexed.$obj->query(%args);This is used for querying the database by distribution name, module name, or CPAN author name. There are two arguments needed to specify such queries. * mode => some_value This specifies what type of query to perform, with mode being one of dist, module, or author, for searching through, respectively, CPAN distribution names, module names, or author names and CPAN ids. * type => query_term This specifies the query term for the search, with type being one of name, to search for an exact match, or search, for searching for partial matches. Perl regular expressions are supported in the query_term for the search option.As well, an option of max_results => some_number will limit the number of results returned; if not specified, this defaults to 200. Requirements: · Perl


CPAN::SQLite Related Software