- or download this
# Create a user agent object
use LWP::UserAgent;
...
$ua->agent("AgentName/0.1 " . $ua->agent);
# Create a request
- or download this
my $req = new HTTP::Request POST => 'http://www.perl.com/cgi-
+bin/BugGlimpse';
$req->content_type('application/x-www-form-urlencoded');
...
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
- or download this
# Check the outcome of the response
if ($res->is_success) {
...
print "Bad luck this time\n";
}