in reply to Re^5: File:Find pattern match question
in thread File:Find pattern match question
Thanks again Ken, I have the following code, I do need to work on it a bit, at the moment it's printing out C:\Temp and nothing else. Athanasius code is printing out each of the P00 and I00 directories I made under C:\Temp for testing. I'll check out your example further, thanks
#!/usr/bin/perl # dirpathdupes use strict; use warnings; use File::Find; use Fcntl; #*****************Path Variables********************** our $wellpath = 'N:\\repos\\open\\Wells\\Regulated\\'; our $surveypath = 'N:\\repos\\open\\Surveys\\Regulated\\'; our $testpath = 'C:\\Temp\\'; #******************************************************* my %dirs; find(\&dir_names, $testpath); my @dup_dirs = grep { $dirs{$_} > 1 } keys %dirs; foreach my $l (@dup_dirs) { print "$l\n"; } sub dir_names { return unless -d; return unless /[IPD]\d{8}$/; ++$dirs{$File::Find::dir};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: File:Find pattern match question
by kcott (Archbishop) on Nov 03, 2013 at 05:07 UTC | |
by RockE (Novice) on Nov 03, 2013 at 11:52 UTC | |
by kcott (Archbishop) on Nov 13, 2013 at 16:44 UTC |