CPAN::SQLite::Info - extract information from CPAN indices
This module extracts information from the CPAN indices $CPAN/modules/03modlist.data.gz, $CPAN/modules/02packages.details.txt.gz, and $CPAN/authors/01mailrc.txt.gz.
A CPAN::SQLite::Info object is created with
CPAN::SQLite::Info
my $info = CPAN::SQLite::Info->new(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
dist_vers
dist_file
cpanid
dist_abs
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"; } }
$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_name
mod_vers
mod_abs
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::SQLite::Index
To install CPAN::SQLite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::SQLite
CPAN shell
perl -MCPAN -e shell install CPAN::SQLite
For more information on module installation, please visit the detailed CPAN module installation guide.