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

please suggest module(s) for doing SCP work...preferably core modules. Thanks

Replies are listed 'Best First'.
Re: scp recommendations
by AndyZaft (Hermit) on Jul 30, 2010 at 19:15 UTC
    I believe if you want to stay with core you will have to go with the system("scp $from $to") route. Otherwise Net::SFTP or Net::SCP is your best bet.
      system("scp", "--", $from, $to)
      unless you want to spend time converting $from and $to into shell literals.
        That's not enough either as scp in order to run another scp as its slave in the remote side, calls ssh as...
        system('ssh', 'scp', '-t', @args)
        But the SSH protocol accepts only a single command string, ssh joins everything in one line and the command arrives at the remote machine as...
        system("scp -t @args")
        And it is called through the shell. That's why @args has to be escaped in order to avoid the remote shell doing unexpected things.
      Otherwise Net::SFTP or Net::SCP is your best bet

      There's also Net::SSH2, which works well, is actively maintained, and has no requirements other than the libssh2 C library.

      Cheers,
      Rob