Dru has asked for the wisdom of the Perl Monks concerning the following question:
Thanks!use warnings; use strict; use LWP::Simple; use LWP::UserAgent; my $ua = new LWP::UserAgent; $ua->agent("AgentName/0.1 " . $ua->agent); print "Content-type: text/html\n\n"; # Create a request my $req = new HTTP::Request POST => 'http://cgi.nessus.org/plugins/sea +rch.html'; $req->content_type('application/x-www-form-urlencoded'); $req->content('search=1999-0874&name=cve_id'); # 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 $res->content; } else { print "No response\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help With First LWP Script
by Mercio (Scribe) on Jul 12, 2004 at 16:41 UTC | |
|
Re: Help With First LWP Script
by hsinclai (Deacon) on Jul 12, 2004 at 15:46 UTC | |
by Dru (Hermit) on Jul 12, 2004 at 16:29 UTC | |
|
Re: Help With First LWP Script
by tomhukins (Curate) on Jul 12, 2004 at 17:36 UTC | |
by Dru (Hermit) on Jul 12, 2004 at 17:51 UTC |