in reply to Re^2: Parsing and converting HTML
in thread Parsing and converting HTML

You are trying to parse your file by line. Every line an HTML::Element object gets created and then destroyed. You can use new_from_file HTML::TreeBuilder method instead.
Sorry if my advice was wrong.