in reply to Re^2: A Confession
in thread A Confession

Why did you give it such a strange title? Is "::Foreign" a common usage within CPAN?

That was not probably my best decision. Anyway, in the beginning Net::SFTP::Foreign was a fork of Net::SFTP that used the OS ssh client to connect with the remote host instead of the Net::SSH::Perl module. So, Net::SSH::Perl was the native transport, and ssh the foreign one.

Later, I rewrote almost all the code, changing its API, for the 1.x series, but the name just stuck.

I used the ::Compat option, and it did not like giving a Debug option to new.

The right option recognized by Net::SFTP is lowercase debug. What happens is that Net::SFTP ignores any option it doesn't recognize while Net::SFTP::Foreign::Compat reports them as errors.

I am not sure about Net::SFTP::Foreign aiming at bug-for-bug compatibility...

The first time I used it (having successfully used Net::SFTP the day before), the upload site refused my connection saying that it had adopted a new public key.

That's how ssh handles host authentication. Net::SFTP::Foreign::Compat promises compatibility at the API level, so that you don't have to change your scripts. But under the hood it still let's ssh handle the SSH configuration in its way.

N::S::F::Compat is just a hack to let people with scripts written for Net::SFTP move to Net::SFTP::Foreign easily and in the early days it was also a way to migrate from the 0.x series to 1.x.

If you can, you should use the real Net::SFTP::Foreign API that is much more powerful, consistent and tested.