getting SFTP to work can be difficult, specially if you want your programs to run under Windows.
Currently there are five different SFTP implementations available from CPAN, and no one is perfect:
- Net::SSH::Perl and Net::SFTP are full implementations of the SSH/SFTP protocols in Perl. The authors took OpenSSH source code and just translated it from C to Perl. It depends on several modules, some of them very difficult to install and nowadays it is mostly unmaintained.
- Net::SSH2 is a perl wrapper for the excellent libssh2 library. Improving at very good pace, it's a very good option. Its only drawback is that being an XS module it can be difficult to install.
- Net::SFTP::Foreign (I am its author): a pure Perl implementation of the SFTP protocol that uses the programs ssh or plink to stablish the SSH tunnel. It's very fast, stable and supports several high level methods not available from the other modules (for instance, glob, find, rget, rput). It's mayor drawback is password authentication: Expect (that BTW, doesn't work under ActiveState Perl on Windows) is required to handle it, and even then it has some problems.
- WWW::Curl: it also uses libssh2 internally to handle SFTP.
- Net::SFTP::Expect: an Expect wrapper for the sftp binary.
Currently, LWP::Protocol::sftp is just and adaptor for Net::SFTP::Foreign, though I plan to add support for Net::SSH2 in the no so distance future... patches are also welcome!