in reply to Re^2: eliminating duplicates with filters
in thread eliminating duplicates with filters

If you want to loop over an array instead of a text file, replace
while (<>) {
with
for (@array) {