Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: in Perl find call looking to exclude folder and ignore duplicate finds.

by Tux (Canon)
on Apr 19, 2023 at 10:30 UTC ( [id://11151761]=note: print w/replies, xml ) Need Help??


in reply to Re^2: in Perl find call looking to exclude folder and ignore duplicate finds.
in thread in Perl find call looking to exclude folder and ignore duplicate finds.

use Cwd qw( abs_path ); my %seen; my $processed_files = 0; find ({ wanted => sub { $File::Find::dir =~ m{^/data/logs/master\b} and return; -f && m/auth\.log$/ or return; $seen{abs_path ($_)}++ and return; save_file ($File::Find::name); $processed_files++; }, follow => 1, }, @ARGV);

Enjoy, Have FUN! H.Merijn
  • Comment on Re^3: in Perl find call looking to exclude folder and ignore duplicate finds.
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11151761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found