Net::SFTP port problem

From: Michael Ragsdale (mragsdal_at_utk.edu)
Date: 07/26/04


Date: Mon, 26 Jul 2004 13:18:09 -0400

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 sftp\n";
$ftp->cd("/PRD/in") or die "cannot cd\n";
$ftp->ascii() or die "cannot ascii\n";
$ftp->append($filename, $ftpname) or die "cannot ftp\n";
$ftp->quit;

Any suggestions on getting this to work?

-Mike