Although I agree that using Perl instead of calling find is probably better, I'm not sure if File::Find::Rule directly supports the operation you are looking for; you might have to build something that lists those paths yourself, but Path::Class or most likely Path::Tiny (see its children method) would probably be very helpful there.
Or, maybe in this case glob can help? (make sure to read its documentation, including File::Glob)
use File::Find::Rule; my @searchLocations = ( glob("/vol/archive[0-9][0-9]/prod/*/$collectArchive/*"), glob("/vol/archive[0-9][0-9]/prod/system/archive/$collectArchive/*") ); my @files = File::Find::Rule->file->in(@searchLocations);
By the way, as a side note, in your example regexes, .+ is probably better written as [^\/]+, because otherwise it may match any number of slashes as well.
In reply to Re: Search directory recursive with regex
by Anonymous Monk
in thread Search directory recursive with regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |