#!/usr/bin/perl -w use Net::FTP; # use the ftp module use strict; my (@filelist, $file, $ftp, $ftp_count); my $host = 'your ip address'; my $user = 'username'; # user name for login my $pass = 'password'; # password for login $ftp_count = 0; $ftp = Net::FTP->new($host, Debug => 0); # start an FTP session $ftp->login($user,$pass); # login $ftp->cwd("bulk_download"); # go to the bulk_dowload directory $ftp->binary; # make sure we ftp the file as binary @filelist = $ftp->ls("*.xml"); # and get the list of .xml files foreach $file (@filelist){ $ftp->get($file); # fetch it, ++$ftp_count; } $ftp->quit; print "For $host found $ftp_count files\n";