I was also thinking that getting flock to work might be a hassle. I have been working on this for a bit and may have come up with a reasonable solution. If I have a temporary variable that is reserved for the purpose of saying "filehandle is in use", then I could fork off at my leisure, and upon their return, check to see if this variable is 0 or 1. If it is 0, set it to 1, write the results, and set it back to 0. If it is 1, sleep for a bit and try again. What does everyone think of that?