in reply to File:Find pattern match question

#!/usr/bin/perl -- use strict; use warnings; use File::Find::Rule qw/ find /; my @dirs = find( -directory , name => qr{([IPD]\d{8}$)}, -in => $wellpath, ); print join "\n", @dirs, '';

Replies are listed 'Best First'.
Re^2: File:Find pattern match question
by RockE (Novice) on Oct 31, 2013 at 13:30 UTC

    Couldn't get this to work

    #!/usr/bin/perl use strict; use warnings; use Fcntl; #use File::Find; #use File::Find::Rule; use File::Find::Rule qw/ find /; #*****************Path Variables******************* our $wellpath = "N:\\repos\\open\\Wells\\Regulated"; our $surveypath = "N:\\repos\\open\\Surveys\\Regulated"; our $temp = "C:\\Temp\\"; #************************************************** my @dirs = find( -directory , name => qr{([MIPD]\d{8}$)}, -in => $temp, ); print join "\n", @dirs, '';
    C:\Temp\hddzip>perl dirpath3.pl Can't locate method File::Find::Rule::-directory at dirpath3.pl line 16. I have installed File::Find::Rule

      :) Try "directory" instead of "-directory"