File-Util
view release on metacpan or search on metacpan
lib/File/Util/Manual.pod view on Meta::CPAN
I<result in considerable slowdowns and bottlenecks in any application.>
=over
=item C<< files_match => qr/regexp/ >>
=item I<OR:> C<< files_match => { and/or => [ qr/listref of/, qr/regexps/ ] } >>
Return only file names matching the regex(es). Preceding directories are
included in the results; for technical reasons they are not excluded (if they
were excluded, C<list_dir()> would not be able to "cascade" or recurse into
subdirectories in search of matching files.
Use the C<files_only> option in combination with this matching parameter to
exclude the preceding directory names.
=item C<< dirs_match => qr/regexp/ >>
=item I<OR:> C<< dirs_match => { and/or => [ qr/listref of/, qr/regexps/ ] } >>
Return only files and subdirectory names in directories that match the
regex(es) you specify. B<BE CAREFUL> with this one!! It doesn't "cascade"
the way you might expect; for technical reasons, it won't descend into
directories that don't match the regex(es) you provide. For example, if you
want to match a directory name that is three levels deep against a given
pattern, but don't know (or don't care about) the names of the intermediate
directories-- THIS IS NOT THE OPTION YOU ARE LOOKING FOR. Use the
C<path_matches> option instead.
B<*NOTE:> Bear in mind that just because you tell C<list_dir()> to match each
directory against the regex(es) you specify here, that doesn't mean you are
telling it to only show directories in its results. You will get file names
( run in 0.623 second using v1.01-cache-2.11-cpan-49f99fa48dc )