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
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: $@";
...