# Fields to fill out, since there is only one button, # try to let Mech find it $mech->submit_form( form_name => 'loginForm', fields => { login => $user, pass => $passwd, secure_login => '0', }, )->is_success() || die "Unable to login to $login_page, stopped"; # Ensure we've logged in successfully my $logout = $mech->find_link( text => "Logout" ); die "Did not log in, stopped" unless $logout;