The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PAUSE::Packages - interface to PAUSE's packages file (02packages.details.txt)

SYNOPSIS

  use PAUSE::Packages 0.02;

  my $pp       = PAUSE::Packages->new;
  my $iterator = $pp->release_iterator();

  while (my $release = $iterator->next_release) {
    print 'path = ', $release->path, "\n";
    print '   modules = ', join(', ', @{ $release->modules }), "\n";
  }
  
  $release = $pp->release('Module-Path');

DESCRIPTION

NOTE: this is very much an alpha release. any and all feedback appreciated.

PAUSE::Packages provides an interface to the 02packages.details.txt file produced by the Perl Authors Upload Server (PAUSE). The file records what version of what modules are included in each release of a distribution that is on CPAN.

PAUSE::Packages processes 02packages.details.txt and caches a transformed version of the data, with the following characteristics:

  • Only the highest numbered version of a module is included.

  • All modules in a release are written together, to make it efficient to iterate over the file release by release. 02packages is sorted by module name, not by release, which means it can't be efficiently processed by an iterator.

The interface for this distribution is very much still in flux, as is the documentation.

METHODS

release_iterator()

See the SYNOPSIS.

This supports one optional argument, well_formed, which if true says that the iterator should only return releases where the dist name and author's PAUSE id could be found:

 my $iterator = PAUSE::Packages->new()->release_iterator(
                    well_formed => 1
                );

This saves you from having to write code like the following:

 while (my $release = $iterator->next_release) {
    next unless defined($release->distinfo);
    next unless defined($release->distinfo->dist);
    next unless defined($release->distinfo->cpanid);
    ...
 }

release($DISTNAME)

Takes a dist name and returns an instance of PAUSE::Packages::Release, or undef if a release couldn't be found for the specified distname.

NOTE

The behaviour of this module changed between version 0.01 and 0.02, so you should make sure you're using 0.02 or later:

  use PAUSE::Packages 0.02;

SEE ALSO

There are at least three other modules on CPAN for parsing 02packages.details.txt. There are two main differences between these modules and PAUSE::Packages: (1) you have to download 02packages yourself, and (2) if there are multiple releases of a dist on CPAN, containing different modules (eg due to refactoring), then you'll see the union of all modules, instead of just the modules in the most recent release.

REPOSITORY

https://github.com/neilbowers/PAUSE-Packages

AUTHOR

Neil Bowers <neilb@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Neil Bowers <neilb@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.