I figured out my problem. It works with $ftp->ls(). Default is the current
directory. I still don't know why the $ftp->ls("webshare:available:") doesn't
work.
-Kathy
--- Forwarded Message from Katherine Richmond ---
>Date: 07 Jul 2001 18:32:14 EDT
>From: Katherine Richmond
>Subject: using Net::FTP
>To: [EMAIL PROTECTED]
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