Okay, so let's add to the error checking. First, I'd do this:
$ftp->login($u, $p) or die "Failed to login: $!\n";
and I'd add this to catch any dir errors:
my $lines = $ftp->dir("/");
die "Can't get directory listing: $!\n" if (!defined($lines));
print join("\n", @$lines), "\n";
Also, it may help to set Net::FTP's Debug level to see what's going on, like this:
my $ftp = Net::FTP->new($host, Debug => 5);
You know there's something in the top level directory? I still wouldn't use '/' since most ftp servers will try to get you a list from the root directory on the box which may fail due to permissions. Add this code to see where you are after you log in:
print "Current directory is ", $ftp->pwd(), "\n";
|