3 # Extract all plain text from an HTML file
6 use HTML::Parser 3.00 ();
13 $inside{$tag} += $num;
14 print " "; # not for all tags
19 return if $inside{script} || $inside{style};
23 HTML::Parser->new(api_version => 3,
24 handlers => [start => [\&tag, "tagname, '+1'"],
25 end => [\&tag, "tagname, '-1'"],
26 text => [\&text, "dtext"],
29 )->parse_file(shift) || die "Can't open file: $!\n";;