13 if (/^=item\s+(.+)/) {
16 $item_key = get_item_key($1);
17 $items{$item_key} .= $_;
19 } elsif (/^=back\b/) {
20 # no more items in this group
22 foreach my $item_key (sort keys %items) {
23 print $items{$item_key};
31 } elsif (defined $item_key) {
32 # part of the current item
34 $items{$item_key} .= $_;
45 warn "Missing =back after final =item.\n";
47 foreach my $item_key (sort keys %items) {
48 print $items{$item_key};
53 # get the sortable key for an item
57 # remove POD formatting
58 $item =~ s/[A-Z]<(.*?)>/$1/g;
60 # remove printf-style escapes
61 # note: be careful not to remove things like %hash
62 $item =~ s/%(?:[scg]|lx|#o)//g;
64 # remove all non-letter characters
65 $item =~ tr/A-Za-z//cd;
77 sort_perldiag.pl - Sort warning and error messages in perldiag.pod
81 B<sort_perldiag.pl> I<file>
85 B<sort_perldiag.pl> is a script for sorting the warning and error
86 messages in F<perldiag.pod>. POD formatting, printf-style escapes,
87 non-letter characters, and case are ignored, as explained in L<perldiag>.