【发布时间】:2011-12-18 06:22:55
【问题描述】:
可能重复:
What's the most efficient way to check for duplicates in an array of data using Perl?
如何查找数组中的重复值?
这是我的数组:
@arr - ("one","two","one","three","two");
输出将是:
one
two
代码:
while (<RFH>) {
chomp;
@arr = split(/\|/,$_);
push(@arr1,$arr[4]."\n");
}
【问题讨论】:
-
为什么“三”不应该出现在输出中?
标签: perl