chdir($nas_location); #change the local directory $ftp=Net::FTP::Recursive->new('172.20.1.36:9921',Timeout=>10,Debug=>1) or die getftploginpass(); my $LOGIN = $hashlogin{"LOGIN"}; my $PASSWORD = $hashlogin{"PASSWORD"}; $ftp->login($LOGIN,$PASSWORD) or $error=1; $ftp->cwd("$remote_path") or $error=1; $ftp->binary(); my @list = $ftp->ls(); my $output = $ftp->rget( map{($_, 1)} $extract); $ftp->quit; print "Got \$output of:\n$output\n";