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(); #### ... Net::FTP=GLOB(0x970b00)>>> CWD XXX Net::FTP=GLOB(0x970b00)<<< 250 OK. Current directory is /XXX Net::FTP=GLOB(0x970b00)>>> TYPE I Net::FTP=GLOB(0x970b00)<<< 200 TYPE is now 8-bit binary Net::FTP=GLOB(0x970b00)>>> PORT 10,0,0,5,111,10 Net::FTP=GLOB(0x970b00)<<< 200 PORT command successful Net::FTP=GLOB(0x970b00)>>> RETR YYY