in reply to HMTL Parser Problem

Firstly the use of CODE tags would make reading your code
easier. but having reformatted your code the reason that the
output file is empty is that you are NOT writing anything to
it. You perform a
print $formatter->format($tree);
that prints to STDOUT but you don't
print FH $formatter->format($tree);
to print to your output file Hope this helps