This script is doing a put, but Perl has a FTP module that works great. 
Here's some I use to export logs to a different host.
The comments should explain what you need to do:

#!/usr/bin/perl -w
# load the FTP modules for Perl
use Net::FTP;
# the source directory where the logs to be FTP'd are located
$sourcedir = "<log directory>";
# the log file to be FTP'd
$filename = "<log filename>";
# the directory on the remote FTP server where the log files will be put
$destdir="<remote directory>";
# the name of the log once on the remote FTP server
$destfile="<remote log filename>";
# debug statements to make sure the script is in the correct directory
#$RESULT=`ls -lay $sourcedir$filename`;
#print "$RESULT \n";
# create a new FTP session with the remote FTP server in *PASSIVE* mode
$ftp = Net::FTP->new("<remote FTP SERVER>", Debug => 1, Passive => 1) || 
die "Can not connect: $@\n";
# use the following username and password to log into the remote FTP server
$ftp->login("<username>", "<password>") || die "Can not login\n";
print "1\n";
# once logged in change to the directory the user wants the log files
$ftp->cwd("$destdir") || die "Can not change directory \n";
print "2\n";
# tell the users it went to the correct directory
print "I'm in directory ", $ftp->pwd(), "\n";
print "3\n";
# changed FTP session into a binary session
$ftp->binary();
# debug statement to make sure the script knows the file to be transfered
#print "$filename \n";
# do a FTP "put" command of the log files the user wanted transfered
$ftp->put("$sourcedir$filename") || die "Can not put $filename $!\n";
print "4\n";
# quit the FTP session
$ftp->quit() || warn "Couldn't quit. Oh well.\n";
print "5\n";



-- 
Jamie Seeman
Secure Computing - Test Engineer
651.628.5420