如何检查是否从命令行在我的系统上安装了Perl模块? [英] How can I check if a Perl module is installed on my system from the command line?
本文介绍了如何检查是否从命令行在我的系统上安装了Perl模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试检查XML :: Simple是否安装在我的系统中。
I tried to check if XML::Simple is installed in my system or not.
perl -e 'while (<@INC>) { while (<$_/*.pm>) { print "$_\n"; } }'
上面的一行代码用于列出我系统中安装的所有模块。然而,它不是列出XML模块。
The above one-liner was used for listing all modules installed in my system. However, it is not listing XML modules.
但是,以下执行正常。
perl -e "use XML::Simple "
问题可能是什么?
推荐答案
您可以通过以下方式检查模块的安装路径:
You can check for a module's installation path by:
perldoc -l XML::Simple
-liner是,它不递归地遍历目录/子目录。因此,只有实用的模块名称作为输出。
The problem with your one-liner is that, it is not recursively traversing directories/sub-directories. Hence, you get only pragmatic module names as output.
这篇关于如何检查是否从命令行在我的系统上安装了Perl模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文