7 # sort comparison function
14 # This always sorts last
15 $a =~ s/THE REST/ZZZZZZ/g;
16 $b =~ s/THE REST/ZZZZZZ/g;
23 my $sort_method = \
&by_category
;
26 foreach $key (sort $sort_method keys %map) {
28 print $sep . $key . "\n";
51 if ($line =~ m/^([A-Z]):\s*(.*)/) {
52 $line = $1 . ":\t" . trim
($2) . "\n";
53 if ($lastline eq "") {
54 $map{$case} = $map{$case} . $line;
57 $case = trim
($lastline);
58 exists $map{$case} and die "Header '$case' already exists";
65 $map{$case} = $map{$case} . $lastline;
69 trim
($lastline) eq "" or die ("Odd non-pattern line '$lastline' for '$case'");
72 $map{$case} = $map{$case} . $lastline;