Help for this page

Select Code to Download


  1. or download this
    # Create a user agent object
             use LWP::UserAgent;
    ...
             $ua->agent("AgentName/0.1 " . $ua->agent);
    
             # Create a request
    
  2. 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);
    
  3. or download this
             # Check the outcome of the response
             if ($res->is_success) {
    ...
                 print "Bad luck this time\n";
             }