in reply to Capturing external reffering url ?
HTTP_REFERER obviously would only work with CGI scripts. If you're concerned about traffic to your web site in general (really a non-Perl issue), consider setting up your web server logs to log referrer information and analyze those instead. That would be far more efficient.