in reply to Finding if a file is open

It appears you are trying to do this under Windows. If so, have a look at the module Win32::SharedFileOpen which appears to do what you want.