#!/usr/bin/perl
use http::request;
use lwp::useragent;
my $ua = new lwp::useragent;
$|=1;
print "content-type:text/html\n\n";
$ua->agent("agentname/1.0 " . $ua->agent);
$ua->timeout(80);
# create a request
my $req = new http::request post => http://search.sina.com.cn/cgi-bin/search/search.cgi;
$req->content_type(application/x-www-form-urlencoded);
my $buffer="ss=sina&_searchkey=%bb%ee%b6%af%2b%bd%b1%cf%ee&_andor=and&s1=%cb%d1%cb%f7";
$req->content($buffer);
# pass request to the user agent and get a response back
my $res = $ua->request($req);
# check the outcome of the response
if ($res->is_success) {
print length($res->content);
print <<end;
<meta http-equiv="refresh" content=1;host="http://***.***.***.***/nperl/autorefresh.pl">
end
;
print $res->content ;
} else {
print "bad luck";
}