in reply to a way to do 'sort|uniq'

Another way:
use warnings; use strict; my %seen; print sort grep !$seen{$_}++, <DATA> __DATA__ c c b c b b a c a b

Caution: Contents may have been coded under pressure.