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.log") or die("Can't open log file"); my $ftp = Net::FTP->new($remotehost, Debug => 10) or do { print FTPLOG "Cannot connect to $remotehost: IronMt: $!"; 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!: $!"; die(); }; $ftp->quit; }