in reply to changing DB delimiters

It looks quite obvious to me what makes the record separator. You are writing records called $guest to a file, and you append newlines to $guest just before storing it. Where else would you expect this to happen?

Now that you have posted all this code (of which most is completely pointless - if you have a question about your database, don't post dozens of lines of HTML generation, it makes it much harder to figure out what's going on), why are you opening the file new_guestbook.html for append if you truncate it to 0 bytes before prints? And why aren't you checking the return value of flock? What if the flock fails?

You should also realize that reading in the entire database and writing it out again is ineffecient. Why not just use a dbm file?

-- Abigail