"Fred Tyler" writes:

> I was trying to use $ENV{'HTTP_REFERER'} in a certain script, and as I
> reloaded the script over and over I noticed that it would constantly
> be changing when the page was loaded directly (and therefore there
> should not have been any HTTP_REFERER at all).


Hi Fred,

In my setup at least, HTTP_REFERER is reset between requests. I
believe non-CGI environment variables will be passed through from the
parent process, and all CGI variables and anything else set by Apache
(i.e. starting with HTTP_) will be reset for each request.

Keep in mind that global variables do keep their value between
requests, so if you have something like:

$ref ||= $ENV{HTTP_REFERER}

or

$ref = $ENV{HTTP_REFERER}
if ($ENV{HTTP_REFERER});

then $ref may retain its value between requests.

If you're seeing this effect in viewed pages, keep in mind the
possibility this is browser caching.

Also make sure your version of mod_perl is up-to-date, as it's
possible you're seeing a bug that's fixed in my version (I'm using the
version that comes with Debian Woody, 1.26).

Good luck!

----Scott.