in reply to LWP::UserAgent and sending the HTTP_REFERER

If you're going to use raw LWP, you need to create a separate HTTP::Request object and set its ->referer property, then pass that to the LWP::UserAgent:
my $req = HTTP::Request->new(); $req->method('GET'); $req->url($uri); $req->referer($referer) if $referer; $content = $http->request($req);

Or you may want to take a look at WWW::Mechanize if you want an all-in-one package. Its docs include referer manipulation in one of the examples, so it would appear to be capable of this.