in reply to Flat Database: Outdated Info Removal

flock (DATAFILEIN, 8); if (open(DATAFILEOUT, ">$catagory.dat") ) { flock (DATAFILEOUT, 2);

Here you unlock the file, then open and clobber it, then lock it again. How do you know some other process didn't add new data to the file in between? Two better solutions would be:

You shouldn't have any trouble getting the viewer to expire old data. You might want to read in all the data and do the necessary expirations first (the code for this part could be reused), and then check to see if there's anything left to display.

Update: It would be a good idea to have the viewer get a read-lock on the file, too.