my $processed_files = 0; find({ wanted => sub { if( $File::Find::name eq '/data/logs/master' ) { $File::Find::prune = 1; # stop searching through this } elsif( -f $File::Find::name && $File::Find::name =~ /auth.log$/ ) { save_file($File::Find::name) } else { # ignore the file } follow => 1 }, @ARGV );