use LWP::UserAgent; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => 'http://mydomain.com/phpshop.gz'); $req->authorization_basic('myusername', 'mypassword'); print $ua->request($req)->as_string;