Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex Perl:搜索包含特定字符串的所有目录_Regex_Perl - Fatal编程技术网

Regex Perl:搜索包含特定字符串的所有目录

Regex Perl:搜索包含特定字符串的所有目录,regex,perl,Regex,Perl,我想在文件夹中搜索文件,假设我正在/Applications/looking for target.exe中搜索: 我现在遇到的问题是,搜索/Applications中的所有内容花费的时间太长/(大约70秒) 我想将搜索范围缩小到:/Applications/Example Version,但每个示例目录的版本都不同 如何使用File::Find仅搜索路径为/Applications/Example-X的目录?使用File Globbing: #!/usr/bin/perl -w @files

我想在文件夹中搜索文件,假设我正在/Applications/looking for target.exe中搜索:

我现在遇到的问题是,搜索/Applications中的所有内容花费的时间太长/(大约70秒)

我想将搜索范围缩小到:/Applications/Example Version,但每个示例目录的版本都不同

如何使用File::Find仅搜索路径为/Applications/Example-X的目录?

使用File Globbing:

#!/usr/bin/perl -w
@files = </Applications/Example-Version*/target.exe>;
foreach $file (@files) {
  print $file . "\n";
} 
#/usr/bin/perl-w
@文件=;
foreach$file(@files){
打印$file。“\n”;
}