如何让App :: cpanminus工作?

Dav*_*d B 7 ubuntu perl cpan

我刚刚安装了ubuntu 10.10的新副本.我按照brian d foy推荐的大纲安装了perl 5.12.2 ,然后通过调用安装了cpanminus curl -L http://cpanmin.us | perl5.12.2 - --sudo App::cpanminus.

现在,cpan5.12.2工作正常,但每当我尝试使用cpanm5.12.2安装模块时,它都找不到它.例如:

$ sudo cpanm5.12.2 -v File::Copy::Recursive
You have make /usr/bin/make
You have LWP 5.837
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching File::Copy::Recursive on cpanmetadb ...
! Finding File::Copy::Recursive on cpanmetadb failed.
Searching File::Copy::Recursive on search.cpan.org ...
! Finding File::Copy::Recursive on search.cpan.org failed.
! Couldn't find module or a distribution File::Copy::Recursive
Run Code Online (Sandbox Code Playgroud)

Dre*_*lor 2

您可以尝试使用perlbrew安装自定义 Perl 解释器。然后您可以激活 5.12.2 版本,安装 cpanm(无需 sudo)并以普通用户身份安装模块,例如。“$ cpanm 我的::模块”

通过使用此方法,您可以获得与每个特定 perlbrew 版本相关的自定义 cpanm 二进制文件。您必须为每个 perlbrew 版本安装 cpan 模块,但最终不会得到像“cpanm5.12.2”这样的二进制文件,而是“cpanm”。Perlbrew 负责设置特定于 perl 版本的路径,恕我直言,这相当方便。