我目前得到這個抓住所有文件下的資產/編輯下多個目錄的Perl列表文件
@files = bsd_glob("Assets/Editor/postprocessbuildplayer_*", GLOB_NOCASE);
但我想訪問開始postprocessbuildplayer_從資產中起我的根文件夾中的所有文件。
例子:
Assets/Temp/Editor/PostprocessBuildPlayer_DWARF
Assets/Directory_1/Editor/PostprocessBuildPlayer_1
Assets/Editor/PostprocessBuildPlayer_Default
整個腳本應該有人知道一個更好的辦法:
#!/usr/bin/perl
# Post Process Build Player -- Master
# Searches for other PostprocessBuildPlayer scripts and executes them. Make sure the other script
# have a name suffix with an underscore "_" like "PostprocessBuildPlayer_AnotherBuild" or whatever.
#
# Based on script by Rob Terrell, [email protected]
use File::Glob ':glob';
# Grab all the PostprocessBuildPlayer files
@files = bsd_glob("Assets/Editor/postprocessbuildplayer_*", GLOB_NOCASE);
foreach $file(@files)
{
if(!($file =~ m/\./))
{
system("chmod", "755", $file);
print "PostProcessBuildPlayer: calling " . $file . "\n";
system($file, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3], $ARGV[4], $ARGV[5], $ARGV[6]);
if ($? == -1)
{
print "command failed: $!\n";
}
else
{
printf "command exited with value %d", $? >> 8;
}
}
}
檢查HTTP://搜索。 cpan.org/~rjbs/perl-5.18.2/lib/File/Find.pm –