http://qs321.pair.com?node_id=1131676


in reply to Re: Question about flock and printing to file
in thread Question about flock and printing to file

From the man page of flock(2) on Linux, the file descriptors created by fork(2) are considered to be the same instance, as if you were calling flock on the same file descriptor in the same process.

The solution would be to open the file after $pm->start, and close it before $pm->finish, so that flock(2) will consider it as a different file descriptor.