# Create a user agent object use LWP::UserAgent; use strict; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)"); $ua->proxy(['http'], '151.100.59.11:3128'); # Create a request my $req = HTTP::Request->new(GET => 'http://www.google.com/'); $req->content_type('application/x-www-form-urlencoded'); $req->content('query=libwww-perl&mode=dist'); #Pass request to the user agent and get a response back my $res = $ua->request($req); my $httpResponse; #Check the outcome of the response if ($res->is_success) { $httpResponse = $res->content; } else { print $res->status_line, "\n"; }