====== Sorting Domain Names By TLD ====== Suppose you have a list of domain names including subdomains, wouldn't it be nice to have those sorted by TLD first, followed by however deeply nested subdomain names? If you happen to use PHP, things are simple (but not as short as in Perl, see link below): Result: Array ( [0] => example.com [1] => ftp.example.com [2] => example.net [3] => mail.example.org [4] => www.example.org ) (Inspiration from here: [[http://www.perlmonks.org/?node_id=299555]])