$mech->default_header(Authorization => 'Basic ' . encode_base64($user . ':' . $pass)); $mech->get($url); $mech->submit();