cc has asked for the wisdom of the Perl Monks concerning the following question:
kind regards#!/usr/bin/perl -w use strict; use warnings; use Net::FTP; use Net::Netrc; use Convert::EBCDIC qw(ascii2ebcdic ebcdic2ascii); my $server = "x.x.x.x"; my $user = "username"; my $password = "pass"; my $destination = "/tmp"; my $file = "/home/file.txt"; my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3); $ftp or die "$server: cannot connect: $@"; $ftp->login ($user,$password) or die "$_: Could not login: " . $ftp->m +essage; $ftp->cwd($destination); # convert to ebcdic & transfer the file open TR, "ascci2ebcdic $file |" or die $!; # Or FQ path $ftp->binary(); $ftp->put(\*TR,$file); $ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: convert ascii2ebcdic and send via ftp
by rinceWind (Monsignor) on Jun 24, 2004 at 14:39 UTC | |
by Grygonos (Chaplain) on Jun 24, 2004 at 15:09 UTC | |
by cc (Beadle) on Jun 25, 2004 at 15:55 UTC |