use WWW::Mechanize; binmode STDOUT, ':utf8'; # Removes 'wide character' warnings $url = "http://localhost/test.cgi"; $mech = WWW::Mechanize->new(); $mech->get($url); if ($mech->success) { if ($mech->form_name( 'frmLookup' )) { $mech->submit_form(form_name => 'frmLookup'); print "Success"; } }