Can't locate CPAN.pm in @INC的解决办法

1、执行perl -MCPAN -e shell出错,提示如下:

[root@fc9 ~]# perl -MCPAN -e shell
Can't locate CPAN.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl .).
BEGIN failed--compilation aborted.

2、到cpan的官方站点下载CPAN模块

http://search.cpan.org/~andk/CPAN-1.9205/lib/CPAN.pm

[root@fc9 ~]#wget http://www.cpan.org/authors/id/A/AN/ANDK/CPAN-2.00.tar.gz

3、解压,编绎,安装

[root@fc9 ~]# tar -zxvf CPAN-1.9205.tar.gz

[root@fc9 ~]# cd CPAN-1.9205

[root@fc9 CPAN-1.9205]# perl Makefile.PL

[root@fc9 CPAN-1.9205]# make

[root@fc9 CPAN-1.9205]# make install

4、成功进入CPAN的shell模式

[root@fc9 CPAN-1.9205]# perl -MCPAN -e shell

你可能感兴趣的:(Can't locate CPAN.pm in @INC的解决办法)