in reply to Re^2: File::Copy - move() function corrupting files
in thread File::Copy - move() function corrupting files

Don't scan for files yourself, make the operating system notify you of changes in the filesystem (inotify or similar APIs). Make sure your code starts processing only after a new file (opened for writing) is closed. For inotify, this seems to be indicated by the IN_CLOSE_WRITE event.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)