my $url = "http://www.kapija.org"; my $username = "User123"; my $password = "Password123"; my $mech = WWW::Mechanize->new(autocheck => 1); $mech->get($url); $mech->form_name('form1'); $mech->field(username => $username); $mech->field(password => $password); $mech->click();