#!/usr/local/bin/perl
#
# $Id: ucmsort,v 2.1 2004/08/31 10:55:34 dankogai Exp $
#
use strict;
my @lines;
my ($head, $tail);
while (<>){
unless (m/^.*//o;
push @lines,[ $u, @words ];
}
print $head;
for (sort {
hex($a->[0]) <=> hex($b->[0]) # Unicode descending order
or $a->[2] cmp $b->[2] # fallback descending order
or $a->[1] cmp $b->[1] # Encoding descending order
}
@lines) {
my $u = shift @$_;
print join(" " => "", @$_), "\n";
}
print $tail;
__END__