yeah I have access to both machines. The reason we need to develop this system is because we are not allowing any kind of ftp access to the live server, i'm not sure about sftp. We just connect using ssh and rsync. After giving it some thought I think I am going to get the file listing from machine a, then check the file exists on machine b by sending a http request for it via LWP. This should be ok because we will only need to list top level folders, so only make a few requests to check the folders exist.
This functionality is a bit limited, but it's enough to fulfill our requirements ;-)