#!/usr/bin/perl use Net::FTP; use File::Listing qw(parse_dir); $host = 'ServerName'; $path = '/home/'; $ftp = Net::FTP->new($host, Timeout => 1800) or die "Cannot contact $host: $!"; $ftp->login('ID', 'PWD') or die "Cannot login ($host):" . $ftp->message; $ftp->cwd($path) or die "Cannot change directory ($host):" . $ftp->message; #@Files = $ftp->ls('-lR'); @Files = 'ls -l'; #@Files = `ls -l $path' if $path is what you want a listing of #$ftp->binary(); #$ftp->ascii(); foreach $file (parse_dir(\@Files)) { my($name, $type, $size, $mtime, $mode) = @$file; $ftp->put("$name") or warn "Could not get $name, skipped: $!"; } $ftp->quit; exit;