in reply to RE: Return a Unique Array
in thread Return a Unique Array

That's nice. Although it is slower than using a hash. Comparing your code against this routine:
sub sort_unique_hash { my %hash; @hash{@_} = (); return sort keys %hash; }
gives (where "foreach" is your code and "hash" is the above):
Benchmark: timing 100000 iterations of foreach, hash... foreach: 14 secs (13.50 usr 0.00 sys = 13.50 cpu) hash: 6 secs ( 5.85 usr 0.00 sys = 5.85 cpu)
This is with:
@list = qw/foo bar baz foo quack bar baz/;
The difference is even more marked if you have rather odd arrays that you want to sort -u. For example, running the code against this array:
@list = ('foo') x 1000;
gives
Benchmark: timing 1000 iterations of foreach, hash... foreach: 12 secs (11.82 usr 0.00 sys = 11.82 cpu) hash: 1 secs ( 0.88 usr 0.00 sys = 0.88 cpu)
Presumably because your code sorts the list before it selects only the unique elements, and the hash approach only sorts the unique list--so you're sorting 1000 elements, and the hash approach just sorts 1.

Just something to think about.