hi
we're using Public/Private Key authentication between SFTP client and server to trnasfer files.
I can login into SFTP server from my client linux debian machine without problems using this command:
# sftp user@server (without password)
but if i try to use a Net::SFTP perl script it doesn't work:
Code:
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::SFTP;
my $server="X.X.X.X";
my $user="myuser";
my $password="";
my %args = (user => "$user", password => "$password", ssh_args => [port => 22]);
my $file="TEST.CSV";
my $sftp=Net::SFTP->new($server, %args);
$sftp->put($file);
exit;
TEST.CSV is there, at the same directory.
I get the following error:
Code:
# perl test.cgi
Use of uninitialized value in concatenation (.) or string at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 245.
Couldn't get handle: No such file or directory at test.cgi line 20
howto solve this problem ?