Codex

HTML::Filter

Section: User Contributed Perl Documentation (3pm)

Updated: 2013-03-25

Index?action=index Return to Main Contents


NAME

HTML::Filter - Filter HTML text through the parser

NOTE

This module is deprecated. The now provides the functionally of much more efficiently with the the handler.

SYNOPSIS

DESCRIPTION

is an HTML parser that by default prints the original text of each HTML element (a slow version of cat?(1) basically). The callback methods may be overridden to modify the filtering for some HTML elements and you can override output() method which is called to print the HTML text.
is a subclass of . This means that the document should be given to the parser by calling the ->parse() or ->parse_file() methods.

EXAMPLES

The first example is a filter that will remove all comments from an HTML file. This is achieved by simply overriding the comment method to do nothing.

The second example shows a filter that will remove any <TABLE>s found in the HTML file. We specialize the start() and end() methods to count table tags and then make output not happen when inside a table.

If you want to collect the parsed text internally you might want to do something like this:

SEE ALSO

HTML::Parser

COPYRIGHT

Copyright 1997-1999 Gisle Aas.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Index

NAME

NOTE

SYNOPSIS

DESCRIPTION

EXAMPLES

SEE ALSO

COPYRIGHT