in reply to Simple Hit Counter

See perlopentut for a correct though still largely useless way to do this. The bit you want is in the "File Locking" section.