Can’tlocate cpan.pm in@inc [How to Solve]

1. An error

occurs when executing perl -MCPAN -e shell, and the prompt is as follows: [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. Download the CPAN module from the official site of 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. Unzip, compile, install

[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. Successfully enter the shell mode of CPAN

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

Similar Posts: