/test1/in/foo.edi
/test1/in/dir/bar.edi
####
/composite/test1_YYYYMMDDHHSS_foo.edi
/composite/test1_YYYYMMDDHHSS_bar.edi
####
#!/usr/bin/perl -s
use strict;
use warnings;
use diagnostics;
use Net::FTP::Find;
my($host) = "ftp2.site.com";
my($user) = "redacted";
my($password) = "redacted";
my($ftpdir) = "/test1/in";
my $ftpfind = Net::FTP::Find->new($host) or die "Can't open $host: $@\n";
$ftpfind->login($user, $password) or die "Can't log $user in: $ftpfind\n";
$ftpfind->cwd($ftpdir) or die "Can't cwd to $ftpdir: $ftpfind\n";
print "this is ftpfind $ftpfind\n"; # sanity check so I know it's doing _something_
$ftpfind->finddepth (\&wanted, "/test1/in");
sub wanted {
print "hello";
print $_;
}
####
$ ./dirwalkftp.pl
this is ftpfind Net::FTP::Find=GLOB(0x10083ce10)
$