#!/usr/bin/perl use strict; use warnings; use Net::FTP; my $host = "blah.blahblah.nl"; my $user = "ftpuser"; my $password = "qwerty"; my $f = Net::FTP->new($host, Port => 22, Debug=> 1) or die "Cannot open $host\n"; $f->login($user,$password) or die "cannot log $user in\n"; my $dir = "/home/files/cool_beans"; $f->cwd($dir) or die "Can't cwd to $dir\n"; my @files = $f->ls; print @files, "\n"; #### bucephalus:Desktop barney$ perl ftp_test.pl Net::FTP>>> Net::FTP(2.77) Net::FTP>>> Exporter(5.66) Net::FTP>>> Net::Cmd(2.29) Net::FTP>>> IO::Socket::INET(1.33) Net::FTP>>> IO::Socket(1.34) Net::FTP>>> IO::Handle(1.33) Net::FTP=GLOB(0x7ff09b0b55d8)<<< SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2 Cannot open blah.blahblah.nl