$req = HTTP::Request->new(GET => $myrequeststring); $req->authorization_basic('username','password'); $res = $ua->request($req); #Check the request if ($res->is_success) { print OUT $ua->request($req)->as_string; } else { print STDOUT "Error: " . $res->status_line . "\n"; }