查看perl已安装模块

tech2024-04-07  66

查看perl已安装模块

In working with numerous servers, some my own and many under client ownership, I bump into interesting issues to tackle (yep, this is obvious I know, we all do!). As most of us do now when stumped, a first resort is to Google the problem and see who has already resolved it.

在使用无数服务器(一些是我自己的,还有很多是客户所有的)时,我遇到了很多有趣的问题要解决(是的,很明显,我知道,我们都做到了!)。 正如我们大多数人现在受难时所做的那样,第一个方法就是向Google提出问题,看看谁已经解决了这个问题。

Just a few weeks ago I was wrestling with a web-based Perl application problem for some advanced scripts that I had not authored and became convinced it was related to modules (does anyone else get flustered with obfuscated Perl error messages?!).

就在几周前,我正在为一些我尚未编写的高级脚本处理基于Web的Perl应用程序问题,并确信它与模块有关(其他人是否会因混淆的Perl错误消息而感到慌乱?!)。

I happened to have a snippet of code for identifying all modules installed tucked away and was finally able to track down which module was not installed that resolved the issue.

我碰巧有一段代码来标识所有隐藏的已安装模块,最终能够找到未安装哪个模块来解决问题。

Perhaps other will find some value in being able to generate lists of modules installed. A disclaimer on this code – I remember finding it through a Google search sometime back (at least a year ago) – but cannot track back down who posted it and where. So – for insuring proper credit is issued – I did not author this handy little piece.

也许其他人会在能够生成已安装模块的列表中找到一些价值。 关于此代码的免责声明-我记得某个时候(至少一年前)通过Google搜索找到了该代码-但无法追溯谁在何处发布了它。 因此,为了确保发行适当的信用,我没有编写这个方便的小片段。

perl -MFile::Find=find -MFile::Spec::Functions -lwe 'find { wanted => sub { print canonpath $_ if /.pmz/ }, no_chdir => 1 }, @INC'

perl -MFile::Find=find -MFile::Spec::Functions -lwe 'find { wanted => sub { print canonpath $_ if /.pmz/ }, no_chdir => 1 }, @INC'

翻译自: https://www.sitepoint.com/finding-installed-perl-modules/

查看perl已安装模块

最新回复(0)