View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Léon Brocard > Module-CPANTS > Module::CPANTS



Annotate this POD


New  2
Open  0
View/Report Bugs
Module Version: 0.20030725   Source  


Module::CPANTS - CPAN Module Testing


  use Module::CPANTS;
  my $c = Module::CPANTS->new();
  my $cpants = $c->data;


This is an initial stab at providing automated testing metrics for the modules on CPAN. Alpha release and all that. It's just out there to test the waters.

CPANTS was initially described by Michael Schwern a long time ago in: It is highly recommended that you read that.

The idea is to have automated module testing reporting back all sorts of metadata about the modules on CPAN.

The current interface is a large hash. The keys in the hash are distributions. For example, the information available for Acme-Colour-0.20.tar.gz is accessible using:

  my $dist = 'Acme-Colour-0.20.tar.gz';
  my $data = $cpants->{$dist};

The actual information currently returned is as follows:

  'Acme-Colour-0.20.tar.gz' => {
    'author' => 'LBROCARD',
    'description' => 'additive and subtractive human-readable colours',
    'files' => [
    'lines' => {
      'nonpod' => 170,
      'pod' => 95,
      'pod_errors' => 0,
      'total' => 265,
      'with_comments' => 8,
    'releases' => '5',
    'requires' => [
    'requires_module' => {
      'Graphics::ColorNames' => 0,
      'List::Util' => 0,
      'Test::Simple' => 0
    'requires_recursive' => [
    'size' => {
      'packed' => 3883,
      'unpacked' => 13078
    'testers' => {
      'fail' => 1,
      'pass' => 5
    'uses' => [

The "author" field is the PAUSE ID of the author of the distribution.

The "description" field is the description listed in the CPAN modules list for the distribibution.

The "lines" field shows the number of POD lines (documentation), number of POD errors reported by Pod::Simple::Checker, non-POD lines (code), lines with comments, and total lines in all the modules in a distribution.

The "files" field is a listref containing interesting files which were found. The following files are deemed interesting at the moment: Makefile.PL, README, Build.PL, META.yml, SIGNATURE, MANIFEST.

The "releases" field contains the total number of releases to CPAN that distribution has.

The "requires_module" field is a hashref containing the module prerequisites listed in the Makefile.PL for the distribution.

The "requires" field is a listref containing all the distributions containing the module prerequisite listed in the Makefile.PL for the distribution.

The "requires_recursive" is the same as "requires" but lists the recursive dependencies. This should be all the distributions that the distribution needs to run.

The "size" contains two fields: the packed and unpacked size of the distribution in bytes.

The "testers" field contains the number of passes and fails reported by the CPAN testers ( The "tests" subfield returns the number of tests in that distribution (this is only available for a limited number of distributions at the moment).

More data is to be added soon. A kwalitee rating may be added soon.

Note that CPANPLUS is very useful for relating modules to distributions.


Leon Brocard <>


This code is distributed under the same license as Perl.

syntax highlighting: