bcrowell has asked for the wisdom of the Perl Monks concerning the following question:

O Monks,

I have an open-source app that lets users upload files to a server via ftp, and I would like to allow sftp as well. Assuming I ever have any users :-), they might be naive users, so I want it to be easy to install. I would also like it to run on both Unix and non-Unix systems.

I started off thinking I'd use Net::SFTP, but when I grabbed it via CPAN it was not straightforward. It had lots of dependencies, one of which was Math::Pari. Math::Pari failed a bunch of its tests after compilation, and the tests still hadn't finished after running all night. OK, if it was just me, I might be willing to work on getting it to run, but I can't ask end-users to go through the same process.

I next thought about doing it via a shell. This has the disadvantage that it won't work outside of Unix, but it wouldn't require any extra installation on a Unix machine. The problem I'm running into is that the Unix sftp command-line program always takes the password via a terminal, whereas my app is a Perl/Tk GUI. I want the user to type the password into a dialog box, and then have the uploading start.

Is there any easy way to do all this?

Thanks in advance, O Monks.

Replies are listed 'Best First'.
Re: sftp from Perl
by ariels (Curate) on Apr 14, 2002 at 19:49 UTC
      Thanks! That was a helpful link. The following was interesting: "Some, like Math::Pari, did not easily install, and could not install with the CPAN module (might be different now, I don't know)." I'm glad to know it's not just something stupid I'm doing :-) I guess Net::SFTP is definitely out, since my end users are likely to have even less code fu than I do.