I sometimes take a different approach to building the array...... Instead of using a simple list, I use a hash and as I get a new value I use it as a key who's value is '1'.
While (<INCOMING>) { $letters{$_} = 1; }
If any 'letter' repeats in <INCOMING>, it overwrites the previous instance in the hash
You can then, get your letters back with keys(%letters).
Or, you can use a variation on that trick against the array that you already have,
@array = ('a','b','a','x','x','b','c');
foreach $char (@array) { $letters{$char} = 1; }
@unique_chars = sort(keys(%letters));
'hope this helps....
keep the rudder amid ship and beware the odd typo