All
How can I put any errors to STDOUT or in the case $ftplog, with a Net::FTP block? This is currently not putting anything to my $ftplog file.
Here is my code:
sub ftpme {
my $remotehost="ftp.foo.com";
my $remotedir="archive";
my $user="xxxxx";
my $pass="xxxxxx";
my $data=$scratchtps;
my $ftplog="/usr/local/log/ftp_IrMt_scratchtapes.log";
my $ftp = Net::FTP->new($remotehost, Debug => 10)
|| die "Cannot connect to $remotehost: IronMt: $!, pri
+nt ($ftplog)";
$ftp->login($user, $pass) or die "Login failed!: $!, p
+rint ($ftplog)";
$ftp->ascii();
$ftp->cwd($remotedir);
$ftp->put($data) or die "FTP put to IrMt failed!: $!,
+print ($ftplog)";
$ftp->quit;
}