$hdrs = new HTTP::Headers(Accept => 'application/octet-stream', User_Agent => 'my program'); $url = new URI::URL($FileURL); ## $FileURL might hold - http://www.whatever.com/me.jpg $req = new HTTP::Request('GET', $url, $hdrs); $ua = new LWP::UserAgent; $ua->timeout($WaitState); ## $WaitState holds a number $resp = $ua->request($req); if ($resp->is_success) { open (DOWNLOAD, "> $Filename") || warn; binmode(DOWNLOAD); print DOWNLOAD $resp->content; close (DOWNLOAD) || warn; return "Success"; } else { return "Fail"; }