in reply to Array Question -- Filtering

or you can use a data structure which never creates duplicates, such as a set.

Jarko has a few modules, I think Set::Scalar is the one which will work for this.

If not maybe List::Util or Scalar::List::Util