I'm wondering if anyone can help me. I installed CPAN.pm via command line and then tried installing a module via CPAN. But I encountered an error:
Can't call method "http" on unblessed reference at /usr/lib/perl5/5.10.0/CPAN/FirstTime.pm line 1866.
I'm wondering if anyone can help me. I installed CPAN.pm via command line and then tried installing a module via CPAN. But I encountered an error:
Can't call method "http" on unblessed reference at /usr/lib/perl5/5.10.0/CPAN/FirstTime.pm line 1866.
This error can be resolved by entering the username and password fields in the proxy that cpan uses. 1] First Install cpan by
sudo yum install perl-CPAN
2] Then run the following command
cpan
It asks for setting basics, then select "NO" option for automatically picking then keep pressing enter till you are asked for "Automatically connect to internet", press no.
3] Then you will be asked for mirror details keep selecting from the list that it provided.
4] Then set the proxy username and password fields
5] Installation will then be complete and it will take you to cpan> prompt like below
cpan>
6] In the prompt enter
install Bundle::LWP
Firstly I'm surprised that CPAN isn't already installed as it has been part of the standard Perl distribution since Perl 5.004 was released fifteen years ago.
Secondly I'm surprised that you're still using Fedora 11. That version has been unsupported since June 2010.
Thirdly, I'm surprised that you want to use CPAN.pm as CPANPLUS and cpanminus are both far better interfaces to CPAN.
But given all of those surprises, if you want CPAN on your system, the best approach is probably to use the one that the Fedora project have pre-built for you.
$ sudo yum install perl-CPAN
There will be a number of CPAN modules available pre-build from Fedora. You can see them all using:
$ yum list available perl-\*
You'll find even more available for recent versions of Fedora.
You can almost certainly get CPANPLUS by installing perl-CPANPLUS. I doubt whether cpanminus is available for such an old version of Fedora.
I just had the same issue while installing Perlbrew.
After doing some debugging, I found out that this error happens because the CPAN logic could not find a mirror candidate. Of course, this could be improved in the CPAN::Mirrors or CPAN::FirstTime by just checking the results returned by the related functions.
Since those are not checked (and thus assumed that always returns some value) I got this meaningless error. But I must say I didn't checked further to see why no value is being returned after all.
You can safely avoid this error by simply selection No as answer for the automatic configuration. Of course, you will need to reply for each one of the configuration directives.
I got this while installing perl 5.16.3 thru perlbrew.
I had the same error, and did not have root privileges. The problem lay with there being two versions of cpan installed:
When I specified the former, things began to work.