http://www.perlmonks.org?node_id=742487


in reply to Custom "sort" routine

Are you sure you even need a custom sort? I don't get what you listed when I use the standard sort. I get the following:

.com.co .com.fj .com.mv .com.nf .com.sb .coop

Which is exactly what you said you wanted. Am I missing something in your example?

For reference, here is my code:

my @items = qw( .com.fj .com.sb .com.nf .com.co .com.mv .coop ); for (sort @items) { print "$_\n"; }