How does one currently get a count of downstream deps?

I don't think this is documented anywhere, so let me blog about it before I forget it. Install the module CPANDB. See if it works by running one sample program, maybe:

  use CPANDB;
  use YAML::Syck;
  print Dump [CPANDB::Distribution->select
             ("order by volatility desc limit 1")];

It may take a while but you will get something like this:

!!perl/array:CPANDB::Distribution 
Exporter
'5.63'
FERREIRA
1
perl
FERREIRA/Exporter-5.63.tar.gz
[...]

The kick now is that after such a command you have the current database on your local disk. I found it in my homedirectory under

.perl/ORLite-Mirror/CPANDB.sqlite

Now you can access it directly and find, e.g., the modules depending on Catalyst::Devel with:

  % sqlite3 ~/.perl/ORLite-Mirror/CPANDB.sqlite
  SQLite version 3.7.4
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite> select distribution from requires where module='Catalyst::Devel';
  Catalyst-Authentication-Credential-OpenID
  Catalyst-Example-InstantCRUD
  Catalyst-Example-InstantCRUDStylish
  Catalyst-Helper-AuthDBIC
  Catalyst-Helper-View-TT-Bootstrap
  Catalyst-Model-Cronolog
  Catalyst-Model-Estraier
  Catalyst-Model-JabberRPC
  Catalyst-Model-SVN
  Catalyst-Model-XMLRPC
  CatalystX-Starter
  Handel
  Task-BeLike-MELO
  Task-CatInABox
  Task-Catalyst
  Task-Catalyst-Tutorial

Leave a comment

About Andreas Koenig

user-pic Perlin' for Berlin