use WWW::Mechanize; use Data::Dumper; # URL to retrieve $url = 'http://myurl.html '; # Create an instance of Mechanize to scrape my $mechanize= WWW::Mechanize->new( autocheck => 1 ); # Grab the form $mechanize->get($url); $mechanize->form_number('1'); ($output) = $mechanize->current_form(); open(FH, '>dump.txt'); print FH Dumper($output); close(FH); $mechanize->click_button(name => 'test');