6 # Split record into lines:
7 my @lines = split /\n/, $record;
10 my ($key) = $lines[$i];
12 while( !($key =~ /^\@deftypefun/) && ($i < 5)) { $i=$i+1; $key = $lines[$i]; }
14 $key = $1 if $key =~ /^\@deftypefun {.*} {(.*)}/;
16 # print STDERR "key $1\n";
21 $/="@end deftypefun"; # Records are separated by blank lines.
22 @records = <>; # Read in whole file, one record per array element.
24 @records = sort { key_of_record
($a) cmp key_of_record
($b) } @records;