如何找到Perl模块的安装位置?

前端之家收集整理的这篇文章主要介绍了如何找到Perl模块的安装位置?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何通过名称获取已安装的Perl模块的路径,
例如时间:: HiRes?

我想这只是因为我必须在SGE Grid Engine系统的不同节点上运行我的perl脚本。有时,甚至作为其他用户名运行。

我可以使用CPAN.pm为自己安装软件包,但它不是那么容易为其他用户安装没有chmod 666文件夹。

解决方法

我创建了 whichpm,一个跨平台CLI(Linux,OSX,Window),通过模块(包)名定位已安装的Perl模块,并且可选地报告有关它们的信息,包括检测偶然的重复。

例子

  1. # Locate the Data::Dumper module.
  2. $ whichpm Data::Dumper
  3. /usr/lib/perl/5.18/Data/Dumper.pm
  4.  
  5. # Locate the Data::Dumper module,and also print
  6. # version information and core-module status.
  7. $ whichpm -v Data::Dumper
  8. Data::Dumper 2.145 core>=5.005 /usr/lib/perl/5.18/Data/Dumper.pm
  9.  
  10. # Locate the Data::Dumper module and open it in your system's default text
  11. # editor.
  12. $ whichpm -e Data::Dumper
  13.  
  14. # Look for accidental duplicates of the Foo::Bar module.
  15. # Normally,only 1 path should be returned.
  16. $ whichpm -a Foo::Bar
  17. /usr/lib/perl/5.18/Foo/Bar.pm
  18. ./Foo/Bar.pm
  19.  
  20. # Print the paths of all installed modules.
  21. $ whichpm -a

安装

先决条件:安装了Perl v5.4.50或更高版本的Linux,OSX或Windows。

从npm注册表安装

安装Node.jsio.js时,按如下所示安装the package

  1. [sudo] npm install whichpm -g

手动安装(OSX和Linux)

>下载the CLI。>使它可执行的chmod x whichpm。>将其移动或符号链接到$ PATH中的文件夹,例如/usr/local/bin(OSX)或/ usr / bin(Linux)。

猜你在找的Perl相关文章