简体   繁体   English

如何根据给定模块列出所有CPAN模块?

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

How can I list all CPAN modules depending on a given module? 如何根据给定模块列出所有CPAN模块? For example, create a list of modules using Class::Workflow? 例如,使用Class :: Workflow创建模块列表?

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. 对于前者,权威但非递归的答案通常是查看META.yml文件,它是大多数现代发行版的一部分。 If there is no such file, you may try looking at the Makefile.PL or Build.PL build tools that ship with it. 如果没有这样的文件,您可以尝试查看随附的Makefile.PL或Build.PL构建工具。 If you want to know all dependencies and not just the direct ones, cf. 如果你想知道所有的依赖关系而不仅仅是直接关系,参见 ghostdog74's answer. ghostdog74的回答。 Specifically, David Cantrell's 'CPANDeps' is very, very handy. 具体来说,David Cantrell的'CPANDeps'非常非常方便。

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. 如果您不想grep一个解压缩的minicpan ,最好的解决方案就像模块的CPANTS条目的“ used by ”部分。

您可以使用CPAN :: Dependency等模块,或者在线尝试此类模块。

我在CPAN上找到了CPAN :: DependencyCPAN :: FindDependencies ,它们可能对你有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM