perl首次安装Can’t locate CPAN.pm in @INC的解决办法

perl -MCPAN -e ‘install “模块名称”

我在在线安装perl 模块时,发现有这样的问题。应该是说没有安装CPAN这个服务吧。

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

[root@GM ~]# perl -MCPAN -e shell

Can’t locate CPAN.pm in @INC (@INC contains:……省略

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

http://search.cpan.org/search?query=CPAN&mode=all

[root@GM ~]#wget http://cpan.communilink.net/authors/id/A/AN/ANDK/CPAN-1.9600.tar.gz

3、解压,编绎,安装

[root@GM ~]# tar -zxvf CPAN-1.9600.tar.gz
[root@GM ~]#cd CPAN-1.9600
[root@GM CPAN-1.9600]# perl Makefile.PL
[root@GM CPAN-1.9600]# make
[root@GM CPAN-1.9600]# make install

4、成功进入CPAN的shell模式

[root@GM CPAN-1.9600]# perl -MCPAN -e shell

5、install XXX 安装对应模块

Can’t locate extUtils/makemaker.pm
centos安装cpan先执行
这个错误!可能是没安装perl-CPAN

yum -y install perl-CPAN

 

Nginx fastcgi perl (pl、cgi)支持

1. 安装FCGI模块

# wget http://search.cpan.org/CPAN/authors/id/B/BO/BOBTFISH/FCGI-0.70.tar.gz
# tar zxvf FCGI-0.70.tar.gz
# cd FCGI-0.70
# perl Makefile.PL
# make
# make install

2. 安装 IO 和 IO::ALL模块

# wget http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/IO-1.25.tar.gz
# tar zxvf IO-1.25.tar.gz
# cd IO-1.25
# perl Makefile.PL
# make
# make install

升级MakeMaker版
#wget http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/ExtUtils-MakeMaker-6.54.tar.gz
#tar zxvf  ExtUtils-MakeMaker-6.54
# perl Makefile.PL
Checking if your kit is complete…
Looks good
Using included version of ExtUtils::Manifest (1.56) as it is newer than the installed version (1.46).
Using included version of ExtUtils::Command (1.16) as it is newer than the installed version (1.09).
Using included version of ExtUtils::Installed (1.43) as it is newer than the installed version (0.08).
Using included version of ExtUtils::Packlist (1.43) as it is newer than the installed version (0.04).
Using included version of ExtUtils::Install (1.52) as it is newer than the installed version (1.33).
Writing Makefile for ExtUtils::MakeMaker
make
make install

# wget http://search.cpan.org/CPAN/authors/id/I/IN/INGY/IO-All-0.41.tar.gz
# tar zxvf IO-All-0.41.tar.gz
# cd IO-All
# perl Makefile.PL
# make
# make install

3. Perl脚本 Continue reading