Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi friends, Is there a way to log the session from a perl ftp session to a file so that i can view the details later ? The requirement is that the logfile has to have the information like 226 Transfer complete , log on and bytes transfered , etc. how do i get this info into the logfile? Please help. thanks in advance Veera

Replies are listed 'Best First'.
Re: Logging a ftp session
by derby (Abbot) on May 19, 2005 at 16:27 UTC
    From the Net::Cmd docs:
    Different packages may implement different levels of debug but a non-zero value results in copies of all commands and responses also being sent to STDERR.
    so
    #!/usr/bin/perl -w use strict; use Net::FTP; $ftp = Net::FTP->new("foo.bar.com", Debug => 1) or die "Cannot connect to foo.bar.com: $@"; ...
    should do the trick.
    -derby
    A reply falls below the community's threshold of quality. You may see it by logging in.