Most of the answers given involve a hash, which is a good idea; the reason for this is that arrays are good for storing, but not for looking up information - hashes are much better suitable for that. You might want to redesign your program slightly, so you store your information in a hash to start with.
However, since you will be sorting the array, there might be a different approach: first sort it, and since it is sorted, remove duplicate elements, which, because of the sorting, will be sequential.
use strict;
use warnings;
my @array = (1,2,5,6,4,2,1,2,3,4,6,4,3,2,4,6,6);
my @sorted = sort {$a <=> $b} @array; # numerically
@array = (sort shift @sorted); # overwrite old array
while (my $element = shift @sorted) {
# if the element differs from the last added, keep it
# otherwise discard
if ($element != $array[-1]) {
push (@array, $element);
}
}
# array is now sorted, no duplicate elements