Perl中安装LWP::Simple的问题

Perl中安装LWP::Simple的问题

代码如下:
#!/usr/bin/perl

use LWP::Simple;
use HTML:arse;
use HTML::Element;
use URI::URL;
print "Content-type: text/html; charset=GB2312\n\n";
$ARGV[0]="http://www.sun126.com";
$html = get $ARGV[0];
$parsed_html = HTML:arse::parse_html($html);
for (@{ $parsed_html->extract_links((a)) }) {$i++;

         $link = $_->[0];
         $url = new URI::URL $link;
         $full_url = $url->abs($ARGV[0]);
         print "$i : $full_url<br>\n";
}
会报如下错误:
Can't locate LWP/Simple.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /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.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /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 /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at getHtmlLink.pl line 5.
BEGIN failed--compilation aborted at getHtmlLink.pl line 5.
如何解决^^^^^谢谢!!
cpan -i LWP::Simple
在perl中调用系统命令system(wget .......)提取一个网页,并得到网页的内容,保存在文件中?
如何做?谢谢!


[Copy to clipboard] [ - ]
CODE:
system("wget -q -O myfile http://www.google.cn")'