+ $summary .= "\n**** Ran in test mode only ****\n" if $test_only;
+ print $summary;
+
+ if ($link_report) {
+ my @keys;
+ print <<_LINKED_HEADER_;
+
+Linked headings (from most frequent to least):
+-------------------------------------------------------
+
+_LINKED_HEADER_
+
+ @keys = sort {
+ $linked_headings{$b} <=> $linked_headings{$a} or "\L$a" cmp "\L$b"
+ } keys %linked_headings;
+ foreach my $key (@keys) {
+ print "$key:\t" . $linked_headings{$key} . " occurrences\n";
+ }
+
+ print <<_UNLINKED_HEADER_;
+
+Unlinked headings (from most frequent to least):
+-------------------------------------------------------
+
+_UNLINKED_HEADER_
+
+ @keys = sort {
+ $unlinked_headings{$b} <=> $unlinked_headings{$a}
+ or "\L$a" cmp "\L$b"
+ } keys %unlinked_headings;
+ foreach my $key (@keys) {
+ print "$key:\t" . $unlinked_headings{$key} . " occurrences\n";
+ }
+
+ print <<_FUZZY_HEADER_;
+
+Fuzzily-matched headings (from most frequent to least):
+-------------------------------------------------------
+
+_FUZZY_HEADER_
+
+ @keys = sort {
+ $fuzzy_headings{$b} <=> $fuzzy_headings{$a} or "\L$a" cmp "\L$b"
+ } keys %fuzzy_headings;
+ foreach my $key (@keys) {
+ print "$key:\t" . $fuzzy_headings{$key} . " occurrences\n";
+ }
+ print $summary;
+ }