标签归档:perl

perl读取远程文件lwp安装

use LWP::UserAgent;  $ua = LWP::UserAgent->new;  $ua->agent("$0/0.1 " . $ua->agent);  # $ua->agent("Mozilla/8.0") # pretend we are very capable browser    $req = HTTP::Request->new(     GET => ’http://www.baidu.com’);  $req->header(’Accept’ => ’text/html’);    # send request  $res = $ua->request($req);  print $res->decoded_content; 缺少网络连接库 LWP的时候报错 Can’t locate LWP/UserAgent.pm in @INC (you may need to install the LWP::UserAgent module) … 继续阅读

发表在 Linux | 标签为 , | 留下评论