use strict; use warnings; use Net::FTP; my ($hostname,$user;$password) = ('A','B','C') # my settings here; my ($directory,$file) = ('XXX','YYY') # my settings here; my $ftp = Net::FTP->new($hostname, Debug => 1); $ftp->login($user,$password) or die "Cannot login ", $ftp->message; $ftp->cwd($directory); $ftp->binary(); $ftp->get($file) or print $ftp->message; $ftp->quit();