#!C:\Perl\bin\perl.exe -w use strict; use warnings; use LWP::UserAgent; my $url = "http://bbs.wenjuantong.com"; open(OUT, ">>respone.txt") or die("Cannot open out file:$!"); my $agent = new LWP::UserAgent(); my $request = new HTTP::Request('get' => $url); $request ->content_type('application/x-www-form-urlencoded'); $request ->content('type=another'); my $response = $agent ->request($request); print(OUT $response->as_string()); print(OUT "\n"); close(OUT) or die("Cannot close out file:$!");