#!/usr/bin/perl use strict; use warnings; use HTML::Tidy; my $contents = do{local $/; }; my $tidy = HTML::Tidy->new( {config_file => q{c:/perm/tidy/cnf/tidy.cnf}} ) or die qq{new failed: $!\n}; $tidy->ignore(type => TIDY_WARNING); $tidy->parse(q{foo.html}, $contents) or die qq{cant parse};; for my $message ( $tidy->messages ) { print $message->as_string; } my $clean = $tidy->clean($contents) or die qq{cant clean}; print $clean; __DATA__ title

body

#### __DATA__ title

body

##
## cant parse at C:\perm\tidy\html_tidy_02.pl line 14, line 1.