# Change the working directory $ftp->cwd($path) or die "Can't change directory ($host):" . $ftp->message; # Retrieve a recursive directory listing @ls = $ftp->ls('-lR'); $ftp->binary(); foreach $file (parse_dir(\@ls)) { my($name) = @$file; print "$name
"; }