CPAN将模块安装到perl5中,而不是site_perl中 [英] CPAN installing modules into perl5 instead of site_perl
问题描述
我正在尝试将某些cpan模块临时安装到自定义文件夹(/ tmp / perl)中。所以我用...来修改构建安装基础...
I'm trying to do a temporary install of some cpan modules into a custom folder (/tmp/perl). So I have amending the build install base with...
o conf mbuildpl_arg "--install_base /tmp/perl"
o conf makepl_arg "INSTALL_BASE=/tmp/perl"
工作正常,将模块安装到现在该目录。我还将PERL5LIB设置为
Which works fine, the modules get installed into that directory now. I also set PERL5LIB with
PERL5LIB=/tmp/perl/lib/5.14.2/:/tmp/perl/lib/site_perl/:/opt/perl/lib/5.14.2/:/opt/perl/lib/site_perl/:
注意,这只是暂时的,在将要销毁的虚拟服务器上。
Note, this is all just temporary, on a virtual server which will be destroyed.
我注意到,以前它会将模块安装到buildpath / lib /中。 5.14.2或buildpath / lib / site_perl
I note that, previously it would install modules into buildpath/lib/5.14.2 or buildpath/lib/site_perl
但是现在,将其安装模块安装到buildpath / lib / perl5
However now, its installing modules into buildpath/lib/perl5
我的理解是,核心perl模块最终出现在buildpath / lib / 5.14.2中,而非核心模块最终出现在buildpath / lib / site_perl中。
My understanding was that core perl modules ended up in buildpath/lib/5.14.2 and non-core modules ended up in buildpath/lib/site_perl.
安装到buildpath / lib / perl5中,是什么决定将其安装到perl5目录(而不是5.14.2或site_perl)中?
As this is installing into buildpath/lib/perl5, what decides to install into the perl5 directory as opposed to 5.14.2 or site_perl ?
推荐答案
除非您重写ExtUtils :: MakeMaker和Module :: Build通过环境变量(即 PERL_MM_OPT
和 PERL_MB_OPT
中的值)或命令行参数ents(例如 cpan
的 mbuildpl_arg
和 makepl_arg
)中的值将在构建时将其硬编码到Perl中。以下命令将为您显示这些位置(用于 .pm
和关联文件):
Unless you override ExtUtils::MakeMaker and Module::Build through environment variables (i.e. values in PERL_MM_OPT
and PERL_MB_OPT
) or command line arguments (e.g. values in cpan
's mbuildpl_arg
and makepl_arg
), locations hardcoded into Perl when it was built will be used. The following command will show you those locations (for .pm
and associated files):
perl -V:'install(privlib|archlib|vendorlib|vendorarch|sitelib|sitearch)'
-
installprivlib
包含Perl随附的纯Perl模块。 -
installarchlib
与具有依赖于拱门或构建的组件的模块相同。 -
installvendorlib
包含由发行版安装的纯Perl模块。 -
installvendorarch
与带有Arch或build-dependent组件的模块相同 -
installsitelib
包含您安装的 pure Perl模块。 -
installsitearch
与带有依赖于建筑或构建的组件的模块相同。 installprivlib
contains the "pure Perl" modules that came with Perl.installarchlib
is the same for modules with arch- or build-dependent components.installvendorlib
contains the "pure Perl" modules installed by your distro.installvendorarch
is the same for modules with arch- or build-dependent components.installsitelib
contains the "pure Perl" modules installed by you.installsitearch
is the same for modules with arch- or build-dependent components.
示例运行:
$ perl -V:'install(privlib|archlib|vendorlib|vendorarch|sitelib|sitearch)'
installprivlib='/usr/share/perl/5.14';
installarchlib='/usr/lib/perl/5.14';
installvendorlib='/usr/share/perl5';
installvendorarch='/usr/lib/perl5';
installsitelib='/usr/local/share/perl/5.14.2';
installsitearch='/usr/local/lib/perl/5.14.2';
 
$ perl -V:'install(privlib|archlib|vendorlib|vendorarch|sitelib|sitearch)'
installprivlib='/home/ikegami/usr/perlbrew/perls/5.20.1t/lib/5.20.1';
installarchlib='/home/ikegami/usr/perlbrew/perls/5.20.1t/lib/5.20.1/x86_64-linux-thread-multi';
installvendorlib='';
installvendorarch='';
installsitelib='/home/ikegami/usr/perlbrew/perls/5.20.1t/lib/site_perl/5.20.1';
installsitearch='/home/ikegami/usr/perlbrew/perls/5.20.1t/lib/site_perl/5.20.1/x86_64-linux-thread-multi';
 
>perl -V:"install(privlib|archlib|vendorlib|vendorarch|sitelib|sitearch)"
installprivlib='C:\progs\sp5280-x64\perl\lib';
installarchlib='C:\progs\sp5280-x64\perl\lib';
installvendorlib='C:\progs\sp5280-x64\perl\vendor\lib';
installvendorarch='C:\progs\sp5280-x64\perl\vendor\lib';
installsitelib='C:\progs\sp5280-x64\perl\site\lib';
installsitearch='C:\progs\sp5280-x64\perl\site\lib';
这篇关于CPAN将模块安装到perl5中,而不是site_perl中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!