Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Problem while FTP

by converter (Priest)
on Oct 27, 2002 at 14:18 UTC ( #208342=note: print w/ replies, xml ) Need Help??


in reply to Problem while FTP

Net::FTP inherits from Net::Cmd. As with any module that inherits from other modules, it's a good idea to check the documentation for all base class modules (the modules listed in the @ISA array, if there is one) when you're learning how to use a particular module. Perl uses the modules listed in @ISA to find methods that are invoked against an object of a particular class when those methods aren't found in the object's class.

Looking at line 26 of Net::FTP (v. 2.62), we see that Net::FTP inherits methods from Exporter, Net::Cmd, and IO::Socket::INET. There's probably not much of interest in the Exporter documentation, but Net::Cmd's documentation lists a method called message that:

Returns the text message returned from the last command

You should be able retrieve the server response for all of the commands you're sending to the server with methods invoked against your $ftp object like so:

open LOG, ">> $LOGFile" or die "IO error opening $LOGFile for append: +$!"; ... $ftp->get($filename); print LOG "[get $filename] server response: ", $ftp->response || 'no r +esponse', "\n";

I hope that helps.


Comment on Re: Problem while FTP
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-09-17 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (72 votes), past polls