Ok, a little more info... I'm using OpenSSH, and the version I am using implements an older version of the SFTP protocol that required it to throw an error when the file you are renaming to already exists (which it does). There has since been a revision to the SFTP protocol spec (
draft-ietf-secsh-filexfer-06.txt) that allows you to specify optional flags to the rename command that can force it to atomically rename one file to an already existing file (which is what I want to do.)
Sounds like I am SOL until 1) I get an SFTP server implementing the new spec and 2) Net::SFTP supports the new spec.