哪些 Perl 模块可以通过复制 lib 文件来安装?

发布于 2024-08-24 01:56:22 字数 473 浏览 7 评论 0原文

我是 Perl 的绝对初学者,并且正在尝试在我的共享 Linux Web 主机上使用一些非核心模块。我没有命令行访问权限,只有 FTP。

主机管理员会考虑根据要求安装模块,但我想要使用的模块会经常更新(例如 DateTime::TimeZone),并且我更愿意准确控制我正在使用的版本。

通过实验,我发现一些模块可以通过将文件从模块的 lib 目录复制到主机上的目录并

use lib "local_path";

在我的脚本中使用来安装,即不需要编译即可安装(再次是 DateTime 和 DateTime::TimeZone )。

我如何判断特定模块是否属于这种情况?我意识到我必须自己解决依赖关系。

另外:如果我希望能够安装任何模块,包括那些需要编译的模块,我在托管方面需要什么?

我猜目前我与其他几个人共享一个虚拟机,而我需要的最低配置是具有 shell 访问权限的专用虚拟机?

I'm an absolute beginner at Perl, and am trying to use some non-core modules on my shared Linux web host. I have no command line access, only FTP.

Host admins will consider installing modules on request, but the ones I want to use are updated frequently (DateTime::TimeZone for example), and I'd prefer to have control over exactly which version I'm using.

By experimentation, I've found some modules can be installed by copying files from the module's lib directory to a directory on the host, and using

use lib "local_path";

in my script, i.e. no compiling is required to install (DateTime and DateTime::TimeZone again).

How can I tell whether this is the case for a particular module? I realise I'll have to resolve dependencies myself.

Additionally: if I wanted to be able to install any module, including those which require compiling, what would I be looking for in terms of hosting?

I'm guessing at the moment I share a VM with several others and the minimum provision I'd need would be a dedicated VM with shell access?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三寸金莲 2024-08-31 01:56:22

请参阅 perldoc perlxs

您可能可以检查模块的源代码 DynaLoader 或类似的内容。这样您就可以查明模块是否使用任何 C 代码。

如果您使用类 UNIX 操作系统,则可以使用包管理器来查看包(perl 模块)安装了哪些文件/库。

See perldoc perlxs.

You can probably inspect the module's source for DynaLoader or something like this. This way you can find out if a module uses any C code.

If you use a unix-like OS, you can use a package manager to see what files/libraries a package (perl module) installs.

堇色安年 2024-08-31 01:56:22

您可以使用

use lib "your_local_path" , 

在这种情况下,您可以在本地路径中包含模块。

You can use

use lib "your_local_path" , 

In this case , you can have module in your local path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文