GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PARSE::CPAN::PACKAGES::FAST (3)

.ds Aq ’

NAME

Parse::CPAN::Packages::Fast - parse CPAN’s package index

CONTENTS

SYNOPSIS



    use Parse::CPAN::Packages::Fast;

    my $p = Parse::CPAN::Packages::Fast->new("/path/to/02packages.details.txt.gz");
    ## Or alternatively, if CPAN.pm is configured
    #my $p = Parse::CPAN::Packages::Fast->new;

    my $m = $p->package("Kwalify");
    # $m is a Parse::CPAN::Packages::Fast::Package object
    print $m->package, "\n";   # Kwalify
    print $m->version, "\n";   # 1.21

    my $d = $m->distribution;
    # $d is a Parse::CPAN::Packages::Fast::Distribution object
    print $d->dist,    "\n";   # Kwalify
    print $d->version, "\n";   # 1.21



DESCRIPTION

This is a largely API compatible rewrite of Parse::CPAN::Packages.

Notable differences are
o The method add_package of Parse::CPAN::Packages::Fast::Distribution is not implemented
o Parse::CPAN::Packages::Fast::Distribution is really a CPAN::DistnameInfo (but this one is compatible with Parse::CPAN::Packages::Distribution>
o A Parse::CPAN::Packages::Fast::Distribution object does not have its packages included in the data structure, but it’s necessary to use the contains method. Likewise, a Parse::CPAN::Packages::Fast::Package object does not include the containing distribution in the data structure, but it’s necessary to use the distribution method.
o The new constructor may be called without the path to the 02packages.details.txt file. In this case CPAN.pm’s logic is used to find an existing packages file. Note that this might be interactive (i.e. if CPAN.pm was never configured, or needs reconfiguration), so don’t do this in batch systems.

    WHY?

Calling Parse::CPAN::Packages’ constructor is quite slow and takes about 10 seconds on my machine. In contrast, the reimplementation just takes a second.

I did some benchmarking of the original module and found no obvious weak point to speed it up. Moose is used here, but does not seem to cause the problem. I suspect that the real problem is just heavy use of method calls.

Also, this module does not have problems with circular references like the original. See BUGS in Parse::CPAN::Packages.

SEE ALSO

Parse::CPAN::Packages, CPAN::DistnameInfo.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PARSE::CPAN::PACKAGES::FAST (3) 2015-10-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.