如何找到Perl模块的安装位置?
发布时间:2020-12-15 21:24:21 所属栏目:大数据 来源:网络整理
导读:如何通过名称获取已安装的Perl模块的路径, 例如时间:: HiRes? 我想这只是因为我必须在SGE Grid Engine系统的不同节点上运行我的perl脚本。有时,甚至作为其他用户名运行。 我可以使用CPAN.pm为自己安装软件包,但它不是那么容易为其他用户安装没有chmod 66
如何通过名称获取已安装的Perl模块的路径,
例如时间:: HiRes? 我想这只是因为我必须在SGE Grid Engine系统的不同节点上运行我的perl脚本。有时,甚至作为其他用户名运行。 我可以使用CPAN.pm为自己安装软件包,但它不是那么容易为其他用户安装没有chmod 666文件夹。 解决方法
我创建了
whichpm ,一个跨平台CLI(Linux,OSX,Window),通过模块(包)名定位已安装的Perl模块,并且可选地报告有关它们的信息,包括检测偶然的重复。
例子 # Locate the Data::Dumper module. $ whichpm Data::Dumper /usr/lib/perl/5.18/Data/Dumper.pm # Locate the Data::Dumper module,and also print # version information and core-module status. $ whichpm -v Data::Dumper Data::Dumper 2.145 core>=5.005 /usr/lib/perl/5.18/Data/Dumper.pm # Locate the Data::Dumper module and open it in your system's default text # editor. $ whichpm -e Data::Dumper # Look for accidental duplicates of the Foo::Bar module. # Normally,only 1 path should be returned. $ whichpm -a Foo::Bar /usr/lib/perl/5.18/Foo/Bar.pm ./Foo/Bar.pm # Print the paths of all installed modules. $ whichpm -a 安装 先决条件:安装了Perl v5.4.50或更高版本的Linux,OSX或Windows。 从npm注册表安装 安装Node.js或io.js时,按如下所示安装the package: [sudo] npm install whichpm -g 手动安装(OSX和Linux) >下载the CLI。>使它可执行的chmod x whichpm。>将其移动或符号链接到$ PATH中的文件夹,例如/usr/local/bin(OSX)或/ usr / bin(Linux)。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |