or download this
ACCESS TO PROTECTED DOCUMENTS
Documents protected by basic authorization can easily be access
+ed like
...
$req = HTTP::Request->new(GET => 'http://www.linpro.no/secret
+/');
$req->authorization_basic('aas', 'mypassword');
print $ua->request($req)->as_string;