my url = "https://mysite.com"; my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->follow_link(text => "Welcome", n => 1); my $f = HTML::Form->parse(< user pass etc EOT # here is a workaround because of some javascript $f->put_input("text", { name => "username" }); $f->value("username" => $username); $f->put_input("text", { name => "password" }); $f->value("password" => $password); $mech->submit();