In the TIMTHOWTDI spirit, you could configure your FTP server to allow only 1 simultanous login for username in question. This will work as a very simple locking mechanism, where only one user will be able to access file on the FTP. One of the users will be your vendor, and another - your perl script.