I needed an API to drive an SFTP session. For political reasons, I am more or less limited on this server to perl5.6.1. I've been unable to get Net::SSH::Perl up and running in that environment, and thus Net::SFTP would not work.
However, Net::SFTP::Foreign now exists, which provides an API to drive SFTP using the OpenSSH sftp binary. Coolness!
The module does more or less just what I need. There is a little bit of brain-deadness. I cursed this at first, then found that each instance of brain-deadness originated in Net::SFTP, of which Net::SFTP::Foreign is a fork.
The most eggregious problem is there does not seem to be a way to change the current working directory. However, I can't seem to find one in Net::SFTP, either, so I can hardly fault the author of this fork.
Other problems are that the ls method doesn't simply get a directory listing of the current working directory if you call it with no parameters. You have to pass it ".". The documentation is less than helpful here, because it simply indicates that there's a mandatory parameter named $remote and describes the method as "Fetches a directory listing of $remote." Well, what is $remote? Why don't you tell me, or at least name it something more descriptive? Turns out it means "the remote directory," and it was named analogously to the get and put methods, which specify the local and remote filenames.
All in all, excellent work making this module work. I owe Salvador Fandiño a non-alcoholic beverage of his choice if he's ever out my way.