in reply to Deleting repeating array elements

perldoc -q duplicate contains the answer of your question. But your code suggest you should use a hash instead of an array.