I use the environmen variable HTTP_REFFERER but that is inacurate for what I really need. It give me the domain name in most cases but how can I get the actual page that was linked from?

What I am doing is doing statictics on my websites and want to know what kind of users we have and where they are finding info on us at. So, findng the webpage they came from is important for this. We want to visit the webpage and see just why the user linked to us. What kind of website give us as a reference and things like that so we can better understand our user needs.

Can this be accomplished?

I am using Perl (.cgi, .pl) Scripts. I know I the browser stores this type of history and I would like to get just the one page back after the user runs our download script.