sub ftp_binary { use strict; use warnings; use 5.010; use Net::FTP; my ( $from, $to, $rftp, $whereto ) = @_; my $cwd_return = $rftp->cwd($whereto) or die "cwd failed to $whereto $!\n"; $rftp->binary or die "binary failed$!\n"; say "$cwd_return uploading $to"; my $ftp_return = $rftp->put( $from, $to ) or warn "put failed for $to $@\n"; say "ftp return was $ftp_return"; return $ftp_return; } sub ftp_ascii { use strict; use warnings; use 5.010; use Net::FTP; my ( $from, $to, $rftp, $whereto ) = @_; my $cwd_return = $rftp->cwd($whereto) or die "cwd failed to $whereto $!\n"; $rftp->ascii or die "ascii failed$!\n"; say "$cwd_return uploading $to"; my $ftp_return = $rftp->put( $from, $to ) or warn "put failed for $to $@\n"; say "ftp return was $ftp_return"; return $ftp_return; }