Can't locate LWP/UserAgent.pm in @INC
在网上搜了一下,基本上给出的是以下两种方法:
方法一:
wget http://www.cpan.org/modules/by-module/LWP/libwww-perl-5.837.tar.gz
tar xvzf libwww-perl-5.837.tar.gz
cd libwww-perl-5.837
perl Makefile.PL
make
make install
方法二:
perl -MCPAN -e 'install Bundle::LWP'
经过实践发现两种方法均不选用,在继续谷歌后,发现了一个不错的方法:
# yum provides "perl(LWP::UserAgent)"
Loaded plugins: fastestmirror,security
Loading mirror speeds from cached hostfile
* epel: mirror.sfo12.us.leaseweb.net
perl-libwww-perl-5.833-5.el6.noarch : A Perl interface to the World-Wide Web
Repo : base
Matched from:
Other : perl(LWP::UserAgent)
perl-libwww-perl-5.833-5.el6.noarch : A Perl interface to the World-Wide Web
Repo : installed
Matched from:
Other : Provides-match: perl(LWP::UserAgent)
# yum install perl-libwww-perl
用这种方法也同时成功安装了以下两个模块,欧耶!
yum provides "perl(Config::IniFiles)"
yum provides "perl(JSON)"