in reply to Re^2: Perl HTML::Tidy
in thread Perl HTML::Tidy
You have a couple of typos - have a look at Use strict and warnings
my @files = glob "$calls_dir/*.hmtl"; # should be $call_dir and 'html'
I don't think this does what you think
$tidy->parse( $file, $contents_of_file )From the docs :
parse( $filename, $str [, $str...] ) Parses a string, or list of strings, that make up a single HTML file. The $filename parm is only used as an identifier for your use. The file is not actually read and opened.
Try instead
pojopen my $in_fh, '<', $file or die "Could not open $file : $!"; my $contents_of_file = do { local $/;<$in_fh> }; close $in_fh; $tidy->parse( $file, $contents_of_file ) or warn "Error parsing $file :$!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl HTML::Tidy
by Anonymous Monk on Feb 02, 2016 at 17:29 UTC |