我想要清除所有元素,将它们存储在数组中,然后从该数组中删除符号链接。问题是我不知道如何删除一个数组中包含在另一个数组中的所有元素,因为我是perl的新手。从perl中删除另一个数组中的一个数组中的元素
贝娄是我的代码到目前为止。
foreach ${dir} (@{code_vob_list})
{
${dir} =~ s/\n//;
open(FIND_FILES, "$cleartool find ${dir} -type f -exec 'echo \$CLEARCASE_PN' |") or die "Can't stat cleartool or execute : $!\n"; #This command gets all files
@{files_found} = <FIND_FILES>;
open(SYMBOLIC_FIND_FILES, "$cleartool find ${dir} -type l -exec 'echo \$CLEARCASE_PN' |") or die "Can't stat cleartool or execute : $!\n"; #This command get all symbolic links
@{symbolic_files_found} = <SYMBOLIC_FIND_FILES>;
#Filter away all strings contained in @{symbolic_files_found} from @{files_found}
foreach my ${file} (@{files_found})
{
#Here I will perform my actions on @{files_found} that not contains any symbolic link paths from @{symbolic_files_found}
}
}
在此先感谢
你在哪里学会把所有的标识符放在花括号里面?我希望你意识到这是不必要的,我相信它会使代码更不易读 – Borodin
尝试查看File :: Find查找这样的任务。 –