in reply to pattern matching with wildcards...

Net::FTP::Common has a grep method which allows you to filter the files you need.

Net::FTP::Simple can do

my @received_filtered_files = Net::FTP::Simple->retrieve_files({ username => $username, password => $password, server => $server, remote_dir => 'path/to/dir', debug_ftp => 1, file_filter => qr/^ba.\.txt/, delete_after => 0, });
which is even easier and uses the full power or perl-regexen.

Update: added the example from the Net::FTP::Simple-documentation.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: pattern matching with wildcards...
by mikerzz (Acolyte) on May 12, 2009 at 16:53 UTC
    CountZero, Thanks for the response. I probably should have mentioned that I can't install any other Perl modules on this server, so I am stuck using only Net::FTP. Mike R
      Net::FTP::Simple is pure Perl, so if the server-admins refuse (for no good reason) to install it, you can still include it in your own home-folder or even as part of your own script.

      Have a look at Yes, even you can use CPAN.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        CountZero, Thanks again for the reply. Yes, I could install the Net::FTP::Simple module in my home directory, but this perl script will not be run from the server where I am developing it. It will be run from a production server that I have no access to. Mike R