#!/usr/bin/perl -s use XML::DT ; our ($spaces,$hr); my $f= shift or die; my %utable = map{($_ => "CATHTML_".$n++ )} ($f,@ARGV); %p1=(-html => 1, -inputenc => 'ISO-8859-1', body => sub{"$c"},# 9 a => sub{if(defined($utable{$v{href}})){$v{href}="#$utable{$v{href}}"}; toxml}, html => sub{$c}, ); %p2=( %p1, body => sub{$c}, head => sub{""}, # div => sub{if($v{class} eq "tiny"){""} else {toxml()}}, ); print "\n"; print dt($f,%p1); print " 
\n" x 10 if $spaces; print "
\n" if $hr; for $f (@ARGV){ print initialName($utable{$f},dt($f ,%p2)); print " 
\n" x 10 if $spaces; print "
\n" if $hr; } print "\n"; sub initialName{my ($name,$text)=@_; if($text =~ m!^(\s*)!) {"$&$'"} else {"$text"} }