Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: package that can handle ftp, sftp, http etc ?

by bittis (Sexton)
on Jul 18, 2008 at 16:20 UTC ( [id://698662]=note: print w/replies, xml ) Need Help??


in reply to Re: package that can handle ftp, sftp, http etc ?
in thread package that can handle ftp, sftp, http etc ?

I guess it is a problem of many interfaces rather than packages, well said :)

One of the requirments of what am writting is that it will be as easy to go through and maintain as possible by my client, and they prefered using one package if possible as they might need to extend it to support different protocols in the future, and they would prefer not having to go through the code to create more handles of other protocols (current requirments are http, ftp, sftp).
The points made as to why one should use packages instead of resorting to system() calls are also good.

I did not realise LWP supported sftp, in which case i might as well use it instead of curl, which appears to be too big of a fuss to use right now

  • Comment on Re^2: package that can handle ftp, sftp, http etc ?

Replies are listed 'Best First'.
Re^3: package that can handle ftp, sftp, http etc ?
by salva (Canon) on Jul 18, 2008 at 17:28 UTC
    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!

Re^3: package that can handle ftp, sftp, http etc ?
by spivey49 (Monk) on Jul 18, 2008 at 16:49 UTC

    LWP should give you the common interface you're looking for. LWP::Protocol::sftp extends LWP for sftp.

    One of the biggest pitfalls I usually run into with system() calls is having to go around my elbow to find a way to regain control, data, etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://698662]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-19 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found