Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

How do I automate an HTML form submission?

by faq_monk (Initiate)
on Oct 08, 1999 at 00:32 UTC ( #763=perlfaq nodetype: print w/ replies, xml ) Need Help??

Current Perl documentation can be found at

Here is our local, out-dated (pre-5.6) version:

If you're submitting values using the GET method, create a URL and encode the form using the query_form method:

    use LWP::Simple;
    use URI::URL;

    my $url = url('');
    $url->query_form(module => 'DB_File', readme => 1);
    $content = get($url);

If you're using the POST method, create your own user agent and encode the content appropriately.

    use HTTP::Request::Common qw(POST);
    use LWP::UserAgent;

    $ua = LWP::UserAgent->new();
    my $req = POST '',
                   [ module => 'DB_File', readme => 1 ];
    $content = $ua->request($req)->as_string;

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-11-25 14:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (677 votes), past polls