in reply to Writing to a log file without colliding

perldoc -q lock
:-)