perl库路径 [英] perl library path

查看:269
本文介绍了perl库路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检索perl库统计信息和发行版所在的路径.该路径是运行脚本所必需的.我在计算机集群上.谁能帮我吗?

I need to retrieve the path where the perl libraries Statistics and Distributions are located. The path is necessary to run the script. I'm on a computer cluster. Can anyone help me?

谢谢

推荐答案

此答案假定实际上已安装了模块,但未将其放置在perl所要查找的位置.

This answer assumes that the module is in fact installed, but not in a place that perl is looking for.

通常,Perl模块Statistics::Distributions将包含在名为Statistics/Distributions.pm的文件中.在Linux和类似系统上,可以使用locate命令快速搜索这些文件:

Generally, the Perl module Statistics::Distributions will be contained in a file called Statistics/Distributions.pm. On Linux and similar systems, one can search for these files quickly with the locate command:

locate Statistics/Distributions.pm

如果已安装,locate将吐出一条类似于

If it is installed, locate will spit out a line similar to

/opt/my_perl/lib/Statistics/Distributions.pm

然后,您也可以指示perl解释器以各种方式在此路径中查找.一种是定义环境变量PERL5LIB,即从bash:

You can then instruct the perl interpreter to look in this path, too, in various ways. One is to define the environment variable PERL5LIB, i.e. from bash:

prompt> PERL5LIB=/opt/my_perl/lib/ ./myscript.pl

或者您可以使用perl -I开关:

prompt> perl -I/opt/my_perl/lib/ ./myscript.pl

或者您可以将脚本修改为use lib;有多种方法可以做到;-)

Or you can modify the script to use lib; there is more than one way to do it ;-)

这篇关于perl库路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆