in reply to Net::FTP Woes
Okay, so let's add to the error checking. First, I'd do this:
and I'd add this to catch any dir errors:$ftp->login($u, $p) or die "Failed to login: $!\n";
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:
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:my $ftp = Net::FTP->new($host, Debug => 5);
print "Current directory is ", $ftp->pwd(), "\n";
|
|---|