Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error running cpan the first time

Tags:

perl

cpan

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.
like image 505
icasimpan Avatar asked Mar 08 '12 07:03

icasimpan


2 Answers

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
like image 53
Guru Avatar answered Oct 23 '22 07:10

Guru


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.

like image 24
Dave Cross Avatar answered Oct 23 '22 05:10

Dave Cross