#!/opt/perl/bin/perl

$centered=0;

print "<HTML><HEAD><TITLE>text</TITLE></HEAD><BODY>\n";

while (<>) {
        if (/^\s{4,}/) {
                unless ($centered) {
                        $centered=1;
                        print "<CENTER><H1>\n";
                }
        } else {
                if ($centered) {
                        $centered=0;
                        print "</H1></CENTER>\n";
                }
        }

        if ($centered) {
                print "<BR>\n";;
        } elsif (/^\s*$/) {
                print "<P>";
        } elsif (/^\s+-/) {
                print "<DD>";
        } elsif (/^\s/) {
                #print "<P>";  # uncomment if you want separate paragraphs
                print "<DD>";  # comment if you do not want indents
        }

        print;

}

print "</BODY></HTML>\n";