in reply to Re: Multiprocess logging mechanism
in thread Multiprocess logging mechanism

While locks of files can be removed and the file handle held open between writes, this should not be done unless you also remember to resynchronise the file handle when you subsequently reacquire a lock on the file handle. Eg.

flock (FH, LOCK_EX); # acquire exclusive lock seek (FH, 1, 0); # resynchronise the file buffer

Failure to resynchronise the file handle can cause many problems where multiple processes are accessing and updating the file handle simultaneously - This aspect of file locking was discussed in detail in this thread.

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'