My script should display from where the last 5 vistors came (The refere Field). Currently it does only display where the last visitor did come from.

Currently I have this : -------------------------------------- &open_file("FILE",">",$filelast); print FILE "The last user just came here from <br><a href=$ENV{'HTTP_REFERER'}>this site</a>.\n"; close(FILE); exit;

sub open_file { local ($filevar, $filemode, $filename) = @_; open ($filevar,$filemode . $filename) | | die ("Can't open $filename"); } ------------------------------------------ How can I tell the script to only write a max. of 5 (or custom numeber) visitors into the $filelast file ?

The last five referers are stored in recent.txt and each time the script runs it grabs the 5 there, drops the oldest, and adds the newest. It uses a semaphore of recent.txt.lck to lock the file for both the read and write.

so they can be collected without the complications that UBB adds to code posted here.

Error 505 is "HTTP Version not supported". Are you able to use server side includes and if you can should they be done as file.html or file.shtml?

And recent.txt should not be empty, but should have the right number of lines. I wrote last5.pl to expect that there are always the correct number of lines. Otherwise we would have to add some extra code to not remove the oldest one each time.

# Finally, add the current visitor to the list of refs. # by escaping the referrer into a safe filename, and then # creating it if it doesn't exist or updating it if it # does. It can be empty for the purposes of this script.