open(CDR, $CDR); open(SORTED_CDR, ">$SORTED_CDR"); @ARRAY=; my @unique = do {my %h; grep {!$h {$_} ++} @ARRAY}; print SORTED_CDR @unique;