SYNOPSIS

     use XPAN::Query qw(
         list_xpan_packages
         list_xpan_modules
         list_xpan_dists
         list_xpan_authors
     );
    
     # the first query will download 02packages.details.txt.gz from a CPAN mirror
     # (the default is "/cpan" or "http://www.cpan.org/") and convert it to a SQLite
     # database, so it will take some time, e.g. several seconds for download (1.5MB
     # at the time of this writing, so a few seconds depending on your connection
     # speed) plus around 10-15s for conversion.
    
     my $res = list_xpan_authors("MICHAEL%"); # => ["MICHAEL", "MICHAELW"]
    
     # the subsequent queries will be instantaneous, unless you change mirror site
     # or 24 hours has passed, which is the default cache period.
    
     my list_xpan_modules(author=>"NEILB", detail=>1);

DESCRIPTION

    XPAN is a term I coined for any repository (directory tree, be it on a
    local filesystem or a remote network) that has structure like a CPAN
    mirror, specifically having a modules/02packages.details.txt.gz file.
    This includes a normal CPAN mirror, a MiniCPAN, or a DarkPAN. Currently
    it excludes BackPAN, because it does not have
    02packages.details.txt.gz, only authors/id/C/CP/CPANID directories.

    With this module, you can query various things about the repository.
    This module fetches 02packages.details.txt.gz and parses it (caching it
    locally for a period of time).

VARIABLES

 $XPAN::Query::CACHE_PERIOD => int (default: 86400)

    Set default cache period, in seconds.

 $XPAN::Query::URL => str (default: "/cpan")

    Set default XPAN URL.

ENVIRONMENT

 XPAN_CACHE_PERIOD => int

    Can be used to preset $XPAN::Query::CACHE_PERIOD.

 XPAN_URL => str

    Can be used to preset $XPAN::Query::URL.

SEE ALSO

    Parse::CPAN::Packages is a more full-featured and full-fledged module
    to parse 02packages.details.txt.gz. The downside is, startup and
    performance is slower.

    Parse::CPAN::Packages::Fast is created as a more lightweight
    alternative to Parse::CPAN::Packages.

    PAUSE::Packages also parses 02packages.details.txt.gz, it's just that
    the interface is different.

    PAUSE::Users parses authors/00whois.xml. XPAN::Query does not parse
    this file, it is currently not generated/downloaded by CPAN::Mini, for
    example.

    Tangentially related: BackPAN::Index

