print 1; use warnings; use strict; use WWW::Mechanize::Firefox; my $go=WWW::Mechanize::Firefox->new(current=>'1'); $go->get('http://www.google.com'); $go->field('q','hello',1); $go->click('btnG'); if($go->on_event()) {exit 0; }