Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Find CPAN Module Counts on #1

wants to merge 1 commit into from

5 participants

chromatic Tatsuhiko Miyagawa Chris Prather Christian Walde Erik DeBill

The Perl module stats on represent a fraction of the modules on the CPAN. has the full count.

This patch adds a suggested migration to change the data source for Perl modules.

Tatsuhiko Miyagawa

Ruby gems and PyPI's modules count distributions not namespaces. So CPAN should also match against Distributions (on not Modules.

Chris Prather

I'm curious to know where itself gets the stats. The numbers on are about 4K higher. The larger number (24K) are roughly what I would expect from a quick scan of a (min)cpan mirror:

$find ~/Dropbox/minicpan/ -type f -name *.tar.gz | wc -l

Isn't it wonderful what a horrible thing trying to make some comparative metrics between languages is?

Christian Walde

perigrin, searching in that way you won't get all dists, since some files use zip or tar.bz2 or possible even more different formats. As far as i can tell, search.cpan counts the unique release files mentioned in 02_packages (which, since it serves to count namespaces, has duplicates). So, the correct way, which the author is already aware of at this point is to extract the releases mentioned in 02_packages, strip version information and collapse the remainder.

Erik DeBill edebill closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 20, 2010
  1. chromatic
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 0 deletions.
  1. +15 −0 db/migrate/20101220190035_fix_cpan_stats.rb
15 db/migrate/20101220190035_fix_cpan_stats.rb
@@ -0,0 +1,15 @@
+class FixCPANStats < ActiveRecord::Migration
+ def self.up
+ r = Repository.find( :first, :conditions => "name = 'CPAN'" )
+ r.url = ""
+ r.regex = "([\\d,]+) Modules"
+ r.update_count
+ end
+ def self.down
+ r = Repository.find( :first, :conditions => "name = 'CPAN'" )
+ r.url = ""
+ r.regex = "authors ([\\d,]+) modules"
+ r.update_count
+ end
Something went wrong with that request. Please try again.