I can get and put a file using Net::FTP if I know the name of the file. I need
to be able to open a directory and get all the files in it, without knowing
their names. Here is my code that 'almost' works.
$ftp->cwd("webshare:available:") or die "Can't cwd to webshare:available:";
my @items = $ftp->ls("webshare:available:");
foreach my $f(@items) {
print "This file is named " . $f;
print "\n";
$ftp->get($f) or die "Can't get file.";
}
There are 2 files in the available directory. The loop runs through twice
printing, "This file is named "
Then I get the error, "Can't get file."
It knows there are 2 files, but somehow does not read the name from $f. Can you
see what I am doing wrong?
Thanks so much,
Kathy Richmond