use WWW::Mechanize;
print "one\n";
my $mech = WWW::Mechanize->new( agent => 'Mozilla 5.0'); print "two\n";
my $top = $mech -> get('http://10.0.0.200/'); print "three\n";
print $top->as_string; print "four\n";
print $mech->content;
#$mech->set_fields( 'password' => 'secret' );
print "five\n";
#my $response = $mech->submit();
$response = $mech->submit_form( form_name => 'LoginForm', fields => { password => "thepass" },
button => "Submit" );
print "six\n";
print $response->content;
####
$ perl testit.pl
one
two
three
500 Can't connect to 10.0.0.200:80 (connect: Operation now in progress)
Content-Type: text/plain
Client-Date: Fri, 18 Jul 2008 01:44:21 GMT
Client-Warning: Internal response
500 Can't connect to 10.0.0.200:80 (connect: Operation now in progress)
four
500 Can't connect to 10.0.0.200:80 (connect: Operation now in progress)
five
There is no form named "LoginForm" at testit.pl line 26
Died at WWW/Mechanize.pm line 1727.
####