chdir 'D:\vspomob\html';# " , " use locale; open ALL,'>','text.html';# open LOG,'>','join.log'; $/ = undef; $chapno = 1; $chappat = qr!

(\s+.*?)(?:

]*>|
)((?:[^<>]|
)+)

!i; print ALL < . HEAD foreach(<*.htm>){ print LOG $_; /([1-9]\d*|0)\./; $page = $1; open F,$_; $_ = ; close F; s/\A.*(?:]*>( (?:|)[.\s]*<\/p>

.+?| [\w\s]*)\s*<\/p>)?/ my $x=$1; if($x){$x=~s!<\/p>

!
!;$x="

$x<\/h1>"}; $x/ie; s/(?:<\/body>.*)?\Z/<\/div>\n/; # s/]*>\s*$page\s*<\/p>//; # s/napa//g; #qr/[b-fh-kn-su-z--](!=[.)])/ s/-\s*(?:
|<\/p>\s*]*>)\s*/-/g; s/\b((?:[-]\s){4,}[-])\b/my $x = $1;$x=~s!\s!!g;$x/eig; s/lll|(?<=[-])111|111(?=[-])//ig;s/ll|(?<=[-])11|11(?=[-])//g; s/\b//ig; s/[(1l|)]//ig;s/\b//ig; s/!O|!|\b\b/10/ig;s/(\d[O!I]*|[!I]\d)/my $x=$1;$x=~tr~O!I~0011~;$x/eg; s/(?]*>(| |)\s*<\/p>/ "

$1<\/h1>"/ei){ $special=$1; }; unless($special){ s/

\s*(?:)?((\d+)\.(\d+)\..*?)(?:<\/p>)?(?=\$1
$2<\/h2>"; print LOG "\n$x\n";$x/eg; }else{ s/<\/?[ibu]>//g; s/([\s>]\d+)\s(?!\/g; # s/((?:]*>(?:[^<>]|
)+[^\s\d]\s*<\/p>\s*)+)((?:]*>\s*\d+\s*<\/p>\s*?)+)/ my ($it,$pn,$i)=($1,$2); my @pn = $pn=~m!(\d+)!g;#, my @it = $it=~m!()!g; if(@it<@pn){@it = ( ( '

?<\/p>' ) x scalar(@it-@pn), @it )}; $i=@pn; $it[$i] =~ s!<\/p>! $pn[$i].'<\/p>'!e while $i--; join '',@it /eg; s/(\d+)\s*(?=
|<\/p>)/$1<\/a>/gi }; # s/]+>/

<!--  -->
<\/pre>/g;
#      
print LOG " done\n";
print ALL "
-- $page --
$_" }; close ALL; close LOG;