Net::SFTP port problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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/
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 =>
                                                    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";

Any suggestions on getting this to work?


Site Timeline