Apache2::CPAN::Search - mod_perl interface to CPAN::Search::Lite::Query
This module provides a mod_perl (2) interface to CPAN::Search::Lite::Query. The modules Apache2::Request and Apache2::Cookie of the libapreq2 distribution are required. A directive
Apache2::Request
Apache2::Cookie
libapreq2
PerlLoadModule Apache2::CPAN::Search
should appear before any of the Location directives using the module. As well, the following directives should be defined in the Apache configuration file.
Location
CSL_db database
the name of the database [required]
CSL_user user
the user to connect to the database as [required]
CSL_passwd password
the password to use for this user [optional if no password is required for the user specified in CSL_user.]
CSL_user
CSL_tt2 /path/to/tt2
the path to the tt2 pages [required].
CSL_dl http://www.cpan.org
the default download location [optional - http://www.cpan.org will be used if not specified]
CSL_max_results 200
the maximum number of results to obtain [optional - 200 will be used if not specified]
The response handler can then be specified as
<Location "/search"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Search->search </Location>
A request for http://localhost/search without any query string will bring up a page of chapterid listings. All other requests are handled through the query string arguments.
http://localhost/search
mode=$value
What results depends on the $value of mode
$value
mode
mode=dist
mode=author
mode=module
This brings up an alphabetical listing with links to pages of either distributions, authors, or modules whose names begin with the indicated letter.
mode=chapter
This brings up a page of links to the main chapter ids.
mode=mirror
This brings up a page whereby the location of the mirror used to get downloads from can be specified.
mode=$mode;query=$query
For this type of request, $mode must be one of dist, module, or author. A search using the specified $query will be done on, respectively, distribution names and abstracts, module names and abstracts, and CPAN ids and full names.
$mode
dist
module
author
$query
mode=$mode;letter=$letter
For this type of request, $mode must be one of dist, module, or author. If $letter is a single letter, this returns, resepctively, all distribution names, module names, or CPAN ids beginning with the specified letter. If $letter is more than one letter, all distribution names matching $letter-* are returned, for mode=dist, or all module names matching $letter::* are returned, for mode=module.
$letter
$letter-*
$letter::*
recent=$age
This brings up a page listing all distributions uploaded in the last $age days.
$age
chapterid=$id
This brings a page listing all subchapters with a chapterid of $id.
$id
chapterid=$id;subchapter=$subchapter
This brings a page listing all distributions categorized in the given $subchapter in the $id chapter.
$subchapter
module=$name
mod_id=$id
This brings up an information page for the module with the specified module name or module table id.
dist=$name
dist_id=$id
This brings up an information page for the distribution with the specified distribution name or distribution table id.
cpanid=$cpanid
author=$cpanid
auth_id=$id
This brings up an information page for the author with the specified CPAN id name or author table id.
Make sure to check the values of $db, $user, $passwd, and $tt2 at the top of this file.
$db
$user
$passwd
$tt2
Apache2::CPAN::Query, CPAN::Search::Lite::Query, and mod_perl.
To install CPAN::Search::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Search::Lite
CPAN shell
perl -MCPAN -e shell install CPAN::Search::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.