http://www.perlmonks.org?node_id=935601


in reply to Looking for an HTML structure-cleaner

You could try HTML::Tidy, which is a front-end to tidyp (aka HTML Tidy). I doubt it cleans up your CSS, though.

"tidyp will validate your HTML, and output cleaned-up HTML."