Been around more than once on similar topics and I am so close to a result I can taste it (ASCII, for those of you that don't know, is sorta tangy, sorta sweet).

So, scenario:

Each time a user hits the submit button, the following is supposed to happen.

1)User name and current time is written to a file in the form: $user|$time 2)Check to see if no one has posted in ten minutes, and if they haven't, I assume they are no longer active and they should be erased from the list.

First, this isn't the whole code .. the rest creates OLD, reads OLD and etc. This section is supposed split the entries, push them into a hash as key,value .. reassemble the hash (deleting keys that have $late values) and print out the new hash (with keys that have no late values).

Problem: Am I evaluating time wrong? Cause when the NEW is recreated, the late user is still there.

You've cut out some code so it is difficult to be certain of what is going wrong. However there are clearly some issues with your code that you might consider addressing.

The impression I have is that you are reading in an entire file, then chopping out the unwanted entries then writing out the new file.

If this assumption is correct (and assuming that the file never gets too large) then the approach I would take is: 1. Open the input file; 2. Attempt to lock it - quit or retry a few times then quit if you can't get the lock - (code as written doesn't check to see if you get the lock or not.); 3. Read the data; 4. Close input file; 5. Read through the data in memory deleting the elements you don't want; 6. Open the output file; 7. Attempt to lock it or quit etc as 2 above; 8. Write the data.

Note that close() will unlock for you.

I would recommend storing datetime|user just in case user contains a | which would confuse things (datetime never will if you use the time function).

I can't see why you need a hash; it takes more memory and is slower than an array and doesn't seem to give you anything more.