#23864 1392974375.00000 new: This is Net::SFTP::Foreign 1.73 #23864 1392974375.00000 new: Loaded from /usr/local/lib/perl5/site_perl/5.16.1/Net/SFTP/Foreign.pm #23864 1392974375.00000 new: Running on Perl v5.16.1 for linux #23864 1392974375.00000 new: debug set to -1 #23864 1392974375.00000 new: ~0 is 18446744073709551615 #23864 1392974375.00000 new: Using backend Net::SFTP::Foreign::Backend::Unix 1.73 #23864 1392974375.00000 _queue_msg: queueing msg len: 5, code:1, id:3 ... [1] 00 00 00 05 01 00 00 00 03 | ......... #23864 1392974375.00000 _get_msg: waiting for message... [1] #23864 1392974375.00000 _do_io: _do_io connected: 1 #23864 1392974375.00000 _do_io: _do_io select(-,-,-, undef) #23864 1392974375.00000 _do_io: _do_io write queue: 9, syswrite: 9, max: 65536, $!: 00 00 00 05 01 00 00 00 03 | ......... #23864 1392974375.00000 _do_io: _do_io select(-,-,-, undef) #### my $sftpHost = $userName . '@' . $hostName; use Expect; my $conn = Expect->new; $conn->raw_pty(1); $conn->log_user(0); $conn->spawn('/usr/bin/ssh', -l => $userName, $hostName, -s => 'sftp') or die "can't spawn ssh"; $conn->expect(1, "Password : "); $conn->send("$passWord\n"); $conn->expect(1, "\n"); $Net::SFTP::Foreign::debug = -1; $sftpHandl = Net::SFTP::Foreign->new(transport => $conn); die "unable to establish SSH connection: ". $sftpHandl->error if $sftpHandl->error; $sftpHandl->setcwd($destPath) or die("Cannot cd to $destPath $!\n") ; $sftpHandl->put($remtPath.$fileFnc,$fileFnc) or die("Couldn't put file in the SFTP Location $!\n");