I have just installed a fresh copy of ubuntu 10.10. I installed perl 5.12.2 following brian d foy's recommended outline and then installed cpanminus by invoking curl -L http://cpa开发者_开发问答nmin.us | perl5.12.2 - --sudo App::cpanminus
.
Now, cpan5.12.2 works fine, but whenever I try to install a module using cpanm5.12.2 it fails finding it. e.g.:
$ 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
You might try using perlbrew to install a custom perl intrepreter. Then you can activate your 5.12.2 version, install cpanm (no sudo required) and install your modules as a normal user eg. "$ cpanm My::Module"
By using this method, you get custom cpanm binaries tied to each specific perlbrew version. You have to install cpan modules for every perlbrew version, but you don't end up with binaries like "cpanm5.12.2" but rather "cpanm". Perlbrew takes care of setting up a perl-version-specific path, which is rather handy IMHO.
I had the same problem. LWP uses $HTTP_PROXY
rather than $http_proxy
on my machine.
If you specify something for $http_proxy without the protocol (in my case, I was missing http:
), it will complain but seems misleading as it doesn't actually find the missing packages.
精彩评论