in reply to Re^3: connecting to ftp sites and download certain files based on file extensions
in thread connecting to ftp sites and download certain files based on file extensions

thanks but I don't have any idea as to how to correct it. The website from which I have to download the data is in public domain and I don't think one needs login and password.
  • Comment on Re^4: connecting to ftp sites and download certain files based on file extensions

Replies are listed 'Best First'.
Re^5: connecting to ftp sites and download certain files based on file extensions
by ptum (Priest) on May 01, 2007 at 14:09 UTC

    OK, so, I think we're looking to see you make some kind of effort, here. What have you done so far? Where is your snippet of relevant and tested code (formatted, of course, in <code> tags)?

    If you look at Net::FTP, you'll see a Synopsis section that shows how to build an FTP connection. Notice how the return value from each operation (new, login, etc.) is tested -- and if it is false, the 'die' instruction is executed with an appropriate error message. This is what I meant by testing to ensure that your $ftp object is really what you think it is. It is pointless to execute the 'cwd' method unless you actually have a working Net::FTP object with which to work. Based on the error message you reported when trying odha57's code above, you aren't getting past the initial new() or login() steps.