Array Perl

@names=('A','C','C','D','E');
@names=join("\n", sort(@names));
print @names,"\n";