my @words = qw(1 2 3 4 4);
my @unique_words = uniq @words;
print @unique_words; # 1 2 3 4
I am interested in finding which value was non-unique, in this case 4. And being able to set it equal to a variable so that I can keep track of which specific value was re-occuring.
I want to do this so I can implement a code that says "if my string contains duplicating value from array completely remove duplicating value from array from string". In this case, if a string contained 1 2 3 4 4. I would like it after the if statement to contain 1 2 3.