in reply to Sort a long list of hosts by domain (code)

This is perfect for the Schwartzian Transform.
my @sorted = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { [join('.',reverse split(/\./)),$_] } @unsorted;
or, to put it into the form you provided,
my $noodle = join($/, map { sprintf("%64s",$_->[1]) } sort { $a->[0] cmp $b->[0] } map { [join('.',reverse split(/\./)),$_] } keys %hash );
Update: to point to merlyn's original post.
--
Brovnik