|
Posted by Michael Ragsdale on July 26, 2004, 2:18 pm
Please log in for more thread options
I'm trying to convert some scripts from running Net::FTP over to Net::SFTP
on a Win32 server. I've installed Net::SFTP via ppm successfully. Running
my code, I get the following:
Can't map service name 'ssh' to port number at H:/Perl/site/lib/Net/SFTP.pm
line 36
I understand on *nix, I could fix this by editing the etc/services file, but
on Win32, I don't know the equivilent. I have added a port argument to my
command, but I get the same error. Here is my code snippet:
my $ftp = Net::SFTP->new("XXXXX.XXXXX.XXXXXXX.XXX", debug => 0,
user => 'XXX',
password =>
'XXXXXXXXXXXXX',
port => 22) or die
"Cannot get new sftpn";
$ftp->cd("/PRD/in") or die "cannot cdn";
$ftp->ascii() or die "cannot asciin";
$ftp->append($filename, $ftpname) or die "cannot ftpn";
$ftp->quit;
Any suggestions on getting this to work?
-Mike
|