#!/usr/local/bin/perl open(text, ">notdtd.txt"); $footsize=0; $headsize=0; $prev = ""; $writing="text"; line: while () { if ($footsize==0) { if (/^Request for Comments/) { $footsize = 3; $headsize = 4; } elsif (/^INTERNET-DRAFT/) { $footsize=1; $headsize=3; }; }; push(@lines,$_); if ($#lines<$footsize) { next line; }; if (/\[Page \d+\]/) { # Skip $footsize+$headsize lines of which ${footsize}th has matched # i.e strip page breaks @lines=(); # throw away $footsize lines for ($i=0;$i<$headsize;$i++) { $_ = ; }; next line; }; $_ = shift(@lines); if ($writing eq "output") { # Stop when a section number is seen if (/^\d+\./) { close output; $writing = "text"; }; } elsif (($file) = /^