in reply to Limiting file:find depth question
#!/usr/bin/perl # dirpath use strict; use warnings; use File::Find; #*****************Path Variables********************** our $testpath = 'C:\\Temp\\'; #******************************************************* find ({ wanted => \&wanted, preprocess => \&preprocess }, $testpath); sub wanted { return unless -d; print "$File::Find::dir/$_\n" if /[IPD]\d{8}$/; } sub preprocess { if ($File::Find::dir =~ /[IPD]\d{8}$/) { return; } else { return @_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Limiting file:find depth question
by Anonymous Monk on Nov 14, 2013 at 08:57 UTC | |
|
Re^2: Limiting file:find depth question
by RockE (Novice) on Nov 14, 2013 at 06:09 UTC | |
by kschwab (Vicar) on Nov 14, 2013 at 06:43 UTC |