CPAN Search Dependents

When I search CPAN, I frequently find it hard to tell which modules to choose. Unless my needs are very specialized, there can be lots of modules that do what I need. But how would I know which module is best to choose?

One factor that can help me decide is the number of CPAN dependents each module has. (Don't confuse "dependent" with "dependency"; I use the word "dependent" to mean: other modules that depend on it.) If a module has lots of other modules that depend on it, then I can be relatively certain that the module might be worth relying on.

The information about the modules' dependents is exposed by http://deps.cpantesters.org/depended-on-by.pl, which is rather cumbersome to use.

So, I created a greasemonkey script which dynamically shows the number of dependents for each module on the search.cpan.org search results. It then displays the list of distributions in order of their numbers of dependents.

CPAN Search Dependents - is the link to the greasemonkey script.

Here is a screenshot of the script in action.

Note that it works better if you show 100 modules at a time, otherwise you might miss distributions that aren't displayed in the first 10 results.

Showing CPAN dependents is only one small factor in measuring the popularity of a module, and popularity isn't the only factor. Down the road I would like to display other information, such as data from Google search.

10 Comments

Sweet. I have a similar problem trying to figure out which SOAP module to use.

Cool. It should be integrated into search.cpan.org.

If you want to use Dependencies as a metric, then you should use the information available on the "Dependencies" link in the search.cpan.org header for each module.

It scans the dependency tree (not only the first level, but the entire tree), and cross-checks with the CPAN Testers information.

Having more dependencies is not a good metric. It only tells you how hard it is to install the module, and not how appropriate it is for your needs.

For example, one module dependencies could all be core modules. So even with multiple dependencies it should install cleanly. Another could have a strange, not commonly used module that fails to install most of the time. Which one is better?

Finally, I do a lot of XMPP work for a living, and I would strongly recommend AnyEvent::XMPP from your example, the one with the largest number of dependencies.

Hi Pedro - with due respect - but I think you missed the point - he is not talking about the modules that a given module depends on, he is talking about the modules that depend on the given module.

This is really useful information and it would be nice to see this built directly into search.cpan.org Thanks for putting this script together.

Just adding a note: This only works for libraries which is meant to be used by other libraries. There are also developer tools like Devel::* or Dist::Zilla vs ShipWright vs Module::Install, or end-user applications like Games::* or App::*. All of those can't be compared this way.

My apologies to Jesse. I did misread dependents as dependencies.

I would like to see the dependents, it gives a metric of real-world use of the module.

I'll try to pay more attention in the future.

This is great work -- thanks for sharing it. We've incorporated it into our cpan-mangler project. :)

http://github.com/oalders/cpan-mangler

Leave a comment

About Jesse Thompson

user-pic I blog about Perl.