#! /usr/bin/perl -w use strict; my $ctr = 0; my $toc; my $out; my $top = ' '; my $skipping = 1; while ( ) { chop; # HTML entities. s|&|&|sg; s|<|<|sg; s|>|>|sg; if ( /^( Changes between.*)/ ) { $out .= "\n" unless $skipping; $skipping = 0; $out .= "

$1$top

\n
\n";
	$toc .= "  
  • $1
  • \n"; $ctr++; } elsif ( ! $skipping ) { $out .= $_ . "\n"; } } $out .= "
    \n"; print "

    Table of contents

    \n"; print "\n"; print $out; exit(0);