我有以下代码:
use strict;
use warnings;
use File::Find::Rule;
my @text = File::Find::Rule->file()
->name('*.txt')
->in('c:\windows','c:\temp');
并且只想在c:\ windows下找到所有.txt文件,而不是在c:\ windows \子目录下找到所有.txt文件,例如c:\ windows \ test1等。 File::Find::Rule
您可以通过使用避免递归->maxdepth(1)
。
IIRC,它需要先于其他过滤器。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句