Hi there Monks!
I need to get some files from my server and save I copy of these files somewhere in a specific directory this code shows it perfectly what I need in order to get the files from my server, but where I tell the FTP where to save the downloaded files into a specific directory?
#!/usr/local/bin/perl -w
use Net::FTP;
$hostname = 'remotehost.com';
$username = 'anonymous';
$password = 'myname@mydomain.com';
# Hardcode the directory and filename to get
$home = '/pub';
$filename = 'TESTFILE';
# Open the connection to the host
$ftp = Net::FTP->new($hostname); # Construct object
$ftp->login($username, $password); # Log in
$ftp->cwd($home),"\n"; # Change directory
print $ftp->ls($home),"\n";
# Now get the file and leave
$ftp->get($filename);
$ftp->quit;
Thanks!!!