use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new( activate => 1, autoclose => 0,); my $url = "https://accounts.google.com/Login"; $mech->get($url); $result = $mech->submit_form( form_id => 'gaia_loginform', fields => { Email => 'xxxx@gmail.com', # name of the input field and value Passwd => 'xxx', } ,button => 'signIn' #name of the submit button ); print $result->content();