Re: Connecting using Net::SFTP - WeOnlyDo Discussion board

Re: Connecting using Net::SFTP (General questions)

by Justin Alcorn, Tuesday, April 24, 2007, 21:15 (6423 days ago) @ wodDamir

I don't own the server. I will ask them to update, but I don't have any control over it.

here is my script:


#!/usr/bin/perl

use Net::SFTP;
my $host = 'xxx.xxx.xxx.xx';
$user = 'yyyyyyyy';
$password = 'zzzzzzzz';
my $sftp = Net::SFTP->new($host,('user' => $user,
'password' => $password,
'debug' => 'true')
);
my @files = $sftp->ls('./');
foreach $filehash (@files) {
print Found file .$filehash->{'filename'}.
;
print longname .$filehash->{'longname'}.
;

It hangs long before any authentication.


Complete thread: