in reply to Re: Re: Filename from filehandle?
in thread Filename from filehandle?

Filehandles that are already opened (especially for writing) have may have already been modified, before the lock was applied. Consider:
open(FOO, ">/tmp/foo") || die; # You've altered the file! flock(FOO, LOCK_EX) || warn; # And now you bother to lock it?
Yeah, it's silly. But you'd be amazed at how often it happens.