in reply to Do I need to lock log files?
Any time you have multiple processes contending for the same resource, you should implement file locking.
open (FILE,">>logfile) or die'; #open the file
flock(FILE,2); # lock it up
seek(FILE,0,2); # in case someone wrote after the open
#print, etc here
print FILE "Log data\n";
# old versions of perl might need an explicit flush here
flock (FILE,8); #unlock it
close(FILE); #close it down