my $mech = WWW::Mechanize->new( keep_alive => 1, ); $mech->credentials( 'theserver.com:80', '', $username, $password );