perlbrew 和 local::lib 同时? [英] perlbrew and local::lib at the same time?

查看:50
本文介绍了perlbrew 和 local::lib 同时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我一直在使用系统 perl(在 Ubuntu 10.10 上),并且使用 local::lib 在我的私有目录 ~/perl5 中安装 CPAN 模块

So far I have been using the system perl (on Ubuntu 10.10) and I was using local::lib to install CPAN modules in my private directory ~/perl5

当我尝试使用 perlbrew 时,他们似乎并不了解彼此.我使用 perlbrew 安装了 perl-5.12.3,但是当我使用 perlbrew 切换到 perl-5.12.3 时,我仍然看到 local::lib 设置的 PERL5LIB 和 PERL_MM_OPT.

As I am trying to use perlbrew it seems that they don't know about each other. I installed perl-5.12.3 using perlbrew but when I switch to it using perlbrew use perl-5.12.3 I still see the PERL5LIB and PERL_MM_OPT set by local::lib.

那不好:

$ cpan XML::Simple
/home/gabor/perl5/perlbrew/perls/perl-5.12.3/bin/perl: symbol lookup error: /home/gabor/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Cwd/Cwd.so: undefined symbol: Perl_Gthr_key_ptr

同时

$ which cpan
/home/gabor/perl5/perlbrew/perls/perl-5.12.3/bin/cpan

所以它使用了正确版本的 cpan 客户端,但由于 PERL5LIB 环境变量,它从错误的位置拾取模块.

so it is using the right version of the cpan client but dues to the PERL5LIB environment variable it picks up the modules from the wrong place.

perlbrew 是否有某种兼容模式,还是我需要手动关闭 PERL5LIB 和 PERL_MM_OPT?

Does perlbrew have some compability mode or do I need to turn off PERL5LIB and PERL_MM_OPT manually?

推荐答案

自从我开始使用 perlbrew 后,我就不再使用 local::lib 作为 shell,因为现在我有了自己的 perl,我对所有东西都有写权限,只需安装到 site_perl 就简单多了,这让我可以为每个 perl 使用不同版本的模块.

Since I started using perlbrew I stopped using local::lib for the shell use, because now that I have my own perl that i have write permissions to everything, just installing to site_perl is much more straightforward, and that allows me to have different versions of modules for each perl.

我仍然使用 local::lib(或者更具体地说,cpanm 的 -l 或 -L 选项会自动设置 local::lib 目录)将特定于应用程序的依赖项保存在应用程序目录中.

I still use local::lib (or more specifically, cpanm's -l or -L options that automatically sets up local::lib directory) to keep application specific dependencies inside an application directory.

这篇关于perlbrew 和 local::lib 同时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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