in reply to FreeBSD reading/writing workaround?

Do make sure that you have file permissions set appropriately- you can test whether that is an issue by doing a chmod 777 filename; default Apache configs run scripts as the user nobody and thus often can't write to or append files which don't have proper permissions.

I'd concur with the other poster who encouraged you to look at the flock node and its sample code for doing file locking in Perl. That's a pretty standard approach for ensuring that multiple running scripts can't write to the same file at the same time. (At least if those scripts are all using flock, you won't have a problem. Read the fine print about advisory locking for more details.)