in reply to Advice on a CGI script

You're not flock'ing the file... if you have 10 simultaneous requests the file will be overwritten during a read (aka race condition).

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.