use strict; use warnings; use Net::FTP; use Net::Netrc; my $remote_cwd = "/test"; my $local_cwd="C:"; my $server="100.200.100.100"; my $ftpid = "abc"; my $pass = "def"; my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3); $ftp->login("$ftpid","$pass"); $ftp->cwd($remote_cwd); my @files = $ftp->ls($remote_cwd); for (@files) { $ftp->get($_) if -f $_; print "\n".$_; } $ftp->quit;