Parse::CPAN::CachedParse CPAN meta files & cache the results | |
Download |
Parse::CPAN::Cached Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Murray
- Publisher web site:
- http://search.cpan.org/~sysmon/
Parse::CPAN::Cached Tags
Parse::CPAN::Cached Description
Parse CPAN meta files & cache the results Parsing the CPAN meta data files can take a few seconds if you do it normally, with: my $p = Parse::CPAN::Packages->new($filename);this wraps the parsing/loading with App::Cache which in turn stores the initial parse in a storable file.Provided the cache hasn't expired, subsequent calls are loaded from this storable file rather than being re-parsed from the original cpan metadata file. If the cache has expired, we re-parse the source.This is probably redundant unless you are repeatadly opening these files (in different processes perhaps).Note: 02packages.details.txt.gz (circa 2009-03) is ~730KB on disk but 13MB as a (App::Cached generated) Storable file. We're trading disk & memory for speed.SYNOPSISEnsure you already have a CPAN::Mini mirror setup, then: use Parse::CPAN::Cached; my $parsers = Parse::CPAN::Cached->new(); # $authors is a Parse::CPAN::Authors (or Parse::CPAN::Whois) object my $authors = $parsers->parse_cpan('authors'); # $distributions is a Parse::CPAN::Packages object my $distributions = $parsers->parse_cpan('packages'); Requirements: · Perl
Parse::CPAN::Cached Related Software