#使用模块Net::FTP
use Net::FTP;
#创建新的FTP连接
$ftp = Net::FTP->new
(
"ftp##", #ftp地址
Timeout => 30
) or die "Could not connect.\n";
#登录用的用户名和密码
$username = 'name';
$password = 'passwd';
#登录到FTP服务器
$ftp->login($username,$password) or die "Could not login.\n";
#切换目录
$ftp->cwd('/www/entrez');
#指定远程的文件和本地的文件
$remotefile = "emotefile";
$localfile = "localfile";
#使用get/put方法下载/上传文件
$ftp->put($localfile,$remotefile) or die "Could not put remotefile:$remotefile\n";
#$ftp->get($remotefile,$localfile) or die "Could not put localfile:$localfile\n";
#退出FTP服务器
$ftp->quit;