简体   繁体   English

在特定的Perl安装中安装CPAN模块

[英]Installing CPAN modules in a specific Perl installation

I have installed Perl in directory "/srv/data203806/MUXmh-Migration/CPAN/localperl/". 我在目录“/ srv / data203806 / MUXmh-Migration / CPAN / localperl /”中安装了Perl。 I have downloaded the tar file and unzipped it. 我已下载tar文件并将其解压缩。 Now how do I install CPAN modules manually to this Perl installation? 现在如何手动将CPAN模块安装到此Perl安装中?

When you are installing a CPAN module as a non-root user then you should use the PREFIX option with Makefile.pl like this: 当您以非root用户身份安装CPAN模块时,您应该使用Makefile.pl的PREFIX选项,如下所示:

perl Makefile.PL PREFIX=<your directory>
make
make install

This will install the module in the directory you have specified with the PREFIX option. 这将将模块安装在您使用PREFIX选项指定的目录中。

Steps to install cpan module: 安装cpan模块的步骤:

  1. Download the .gz file from cpan website 从cpan网站下载.gz文件
  2. Extract the .gz file 解压缩.gz文件
  3. Go to the extracted directory 转到解压缩的目录
  4. Run the following commands 运行以下命令

     perl Makefile.pl PREFIX=<local directory you need> make make install 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM