I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-03-17 19:15:42-08 by ptcmark
Secure Copy with Net::SSH::Perl
Hi, I just loaded up Net::SSH::Perl, and it is great! I need to do a secure copy, but don't see any 'scp', or 'copy' methods. Or, a Net::SCP::Perl module. There is the Net::SCP, but it requires the Net::SSH module. I'd hate to have to maintain both distributions on the project. Am I being stupid and missing something? Thanks! -Mark
Direct Responses: 2462 | Write a response
Posted on 2006-06-12 15:08:45-07 by christian in response to 1961
Re: Secure Copy with Net::SSH::Perl
Hi Mark!

I had the same problem. Maybe this is also a solution for you.

$ssh->login("XXXXX", "XXXXXXX"); my $localFile = 'file-to-copy'; my $remoteFilename = 'target-file-name'; # Read content from source file my $data; open(SCP,$localFile); while (<SCP>) { $data .= $_; } close(SCP); # "Print" out $data on remote STDIN. Redirect STDIN to a regular file using cat my ($out, $err, $exit) = $ssh->cmd("/bin/cat > " . $remoteFilename,$data);

I've used md5sum to ensure that the src files and dst files are identical.

Cheers,

Christian Schaefer
Direct Responses: 9131 | Write a response
Posted on 2008-10-25 16:08:07-07 by thekat in response to 2462
Re: Secure Copy with Net::SSH::Perl
The problem here is that this relies on the STDIN handling on Net::SSH::Perl, which has a bug if your STDIN is too large.
Direct Responses: Write a response