ss_ham has asked for the wisdom of the Perl Monks concerning the following question:
During the find process in above section, how to exclude directory /data/logs/master during search process and also ignore duplicate finds. Is this how we define exclude and what about duplicate finds?#!/usr/bin/env perl <code> my $processed_files = 0; find({ wanted => sub { save_file($File::Find::name) if -f $_ && $_ =~ /auth\.log$/ }, follow => 1 }, @ARGV );
my $processed_files = 0; find( { wanted => sub { save_file($File::Find::name) if -f $_ && $_ =~ /auth\.log$/ && $File::Find::dir ne '/data/logs/master'; }, follow => 0 }, @ARGV );
|
|---|