icasimpan icasimpan - 6 months ago 82
Perl Question

error running cpan the first time

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.


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.