CPAN::Search::Lite::Info - extract information from CPAN indices
This module extracts information from the CPAN indices $CPAN/indices/ls-lR.gz, $CPAN/modules/03modlist.data.gz, $CPAN/modules/02packages.details.txt.gz, and $CPAN/authors/01mailrc.txt.gz. If a local CPAN mirror isn't present, it will use the files fetched from a remote CPAN mirror under CPAN by CPAN::Search::Lite::Index.
CPAN
A CPAN::Search::Lite::Info object is created with
CPAN::Search::Lite::Info
my $info = CPAN::Search::Lite::Info(CPAN => $cpan);
where $cpan specifies the top-level CPAN directory underneath which the index files are found. Calling
$cpan
$info->fetch_info();
will result in the object being populated with 3 hash references:
$info->{dists}
This contains information on distributions. Keys of this hash reference are the distribution names, with the associated value being a hash reference with keys of
version
filename
cpanid
description
size
date
md5
modules
for my $module (keys %{$info->{$distname}->{modules}}) { print "Module: $module\n"; }
chapterid
for my $id (keys %{$info->{$distname}->{chapterid}}) { print "For chapterid $id\n"; for my $sc (keys %{$info->{$distname}->{chapterid}->{$id}}) { print " Subchapter: $sc\n"; } }
requires
$info->{mods}
This contains information on modules. Keys of this hash reference are the module names, with the associated values being a hash reference with keys of
dist
dslip
$info->{auths}
This contains information on CPAN authors. Keys of this hash reference are the CPAN ids, with the associated value being a hash reference with keys of
fullname
email
CPAN::Search::Lite::Index
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.