1 #!/usr/bin/perl -w 2 use strict; 3 use LWP::UserAgent; 4 5 my $useragent = new LWP::UserAgent; 6 my $url = 'http://www.baidu.com'; 7 my $request = HTTP::Request->new(GET => $url); 8 my $repose = $useragent->request($request); 9 print $repose->as_string; 10 #网站源码 11 print " ",$repose->status_line, " "; 12 #响应码