Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I list all CPAN modules depending on a given module?

Tags:

perl

cpan

How can I list all CPAN modules depending on a given module? For example, create a list of modules using Class::Workflow?

like image 732
Kiffin Avatar asked Feb 27 '10 11:02

Kiffin


1 Answers

There's two valid questions about dependencies:

  • What modules does the given module require?

  • The reversed question: Which modules depend on the given module?

For the former, the authoritative but non-recursive answer is usually to look at the META.yml file that's part of most modern distributions. If there is no such file, you may try looking at the Makefile.PL or Build.PL build tools that ship with it. If you want to know all dependencies and not just the direct ones, cf. ghostdog74's answer. Specifically, David Cantrell's 'CPANDeps' is very, very handy.

Obviously, the latter question is impossible to answer by inspecting the module itself. If you don't want to grep an unpacked minicpan, the best solution is something like the "used by" section of a module's CPANTS entry.

like image 191
tsee Avatar answered Oct 22 '22 01:10

tsee