Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: connecting to ftp sites and download certain files based on file extensions

by rkumar1612 (Initiate)
on Apr 29, 2007 at 20:07 UTC ( [id://612670]=note: print w/replies, xml ) Need Help??


in reply to Re: 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

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^2: connecting to ftp sites and download certain files based on file extensions

Replies are listed 'Best First'.
Re^3: connecting to ftp sites and download certain files based on file extensions
by ptum (Priest) on Apr 30, 2007 at 13:53 UTC

    In general, when you see a message like that, Perl is telling you that you are trying to call an object method (in this case, 'cwd') on something that is not actually an object of that type. As Inigo Montoya says about Vizzini's use of the word 'inconceivable': "I do not think that word means what you think it means." Perl is saying, "I do not think that $ftp variable is really a Net::FTP class member."

    The real error seems to be that your $ftp object creation didn't actually succeed -- you may want to look back at the results from the new() and login() methods to make sure that you do, in fact, have a valid, connected Net::FTP object when you call the 'cwd' method.

      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.

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://612670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-24 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found