in reply to Bad file descriptor' error with automated FTP script.

I haven't used the dir() method in Net::FTP before but, by looking at your code, it appears that it returns far more that you need by the way you are parsing out the file name. Is it possible that your code is not getting the correct file name?
Try the ls() method instead.
my $files = $ftp->ls(); # this returns an arrayref for my $filename (@$files) { # put your code in here to deal with each file }

Replies are listed 'Best First'.
Re: Re: Bad file descriptor' error with automated FTP script.
by Anonymous Monk on May 14, 2004 at 08:19 UTC
    The command "dir" gives the equalent of "ls -l" (long list) and "ls" only gives me the filename, In my script the date check is also there. As you can see the logs --"getting ...." is the file name and also in "... exists, so no need to download"

    ============================
    Getting TTFILE008499;1 TTFILE008499 exist, So no need to download
    ========================
      I don't see you using the date/time there. (Surely that -f gets a filename?). In any case, you could check if the parsing of the dir() output is producing rubbish.

      If you need the last modification time of the file, there is also a mdtm(Filename) command which will give you that.

      Also, adding a Debug => 1 to your new() call may give some helpful clues. C.