I just got an email about this very thing:
This is a daily mailing from the Perl FAQ a Day website.
For subscription info, or to have your address removed from
the mailing list, please see
http://perl.faq-by-day.org/
Question:
How do I automate an HTML form submission?
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('http://www.perl.com/cgi-bin/cpan_mod');
$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 'http://www.perl.com/cgi-bin/cpan_mod',
[ module => 'DB_File', readme => 1 ];
$content = $ua->request($req)->as_string;
--