This might do the trick:
sub ftpme { my $remotehost="ftp.foo.com"; my $remotedir="archive"; my $user="xxxxx"; my $pass="xxxxxx"; my $data=$scratchtps; local *FTPLOG; open(FTPLOG, ">>/usr/local/log/ftp_IrMt_scratchtapes.l +og") or die("Can't open log file"); my $ftp = Net::FTP->new($remotehost, Debug => 10) or do { print FTPLOG "Cannot connect to $remotehost: I +ronMt: $!"; die(); }; $ftp->login($user, $pass) or do { print FTPLOG "Login failed!: $!"; die(); }; $ftp->ascii(); $ftp->cwd($remotedir); $ftp->put($data) or do { print FTPLOG "FTP put to IrMt failed!: $!"; di +e(); }; $ftp->quit; }
In reply to Re: Net::FTP and putting errors to STDOUT???
by ikegami
in thread Net::FTP and putting errors to STDOUT???
by drock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |