|
NAMEHTML::Clean - Cleans up HTML code for web browsers, not humansSYNOPSISuse HTML::Clean; $h = HTML::Clean->new($filename); # or.. $h = HTML::Clean->new($htmlcode); $h->compat(); $h->strip(); $data = $h->data(); print $$data; DESCRIPTIONThe HTML::Clean module encapsulates a number of common techniques for minimizing the size of HTML files. You can typically save between 10% and 50% of the size of a HTML file using these methods. It provides the following features:
The entire proces is configurable, so you can pick and choose what you want to clean. THE HTML::Clean CLASS$h = HTML::Clean->new($dataorfile, [$level]);This creates a new HTML::Clean object. A Prerequisite for all other functions in this module.The $dataorfile parameter supplies the input HTML, either a filename, or a reference to a scalar value holding the HTML, for example: $h = HTML::Clean->new("/htdocs/index.html"); $html = "<strong>Hello!</strong>"; $h = HTML::Clean->new(\$html); An optional 'level' parameter controls the level of optimization performed. Levels range from 1 to 9. Level 1 includes only simple fast optimizations. Level 9 includes all optimizations. $h->initialize($dataorfile)This function allows you to reinitialize the HTML data used by the current object. This is useful if you are processing many files.$dataorfile has the same usage as the new method. Return 0 for an error, 1 for success. $h->level([$level])Get/set the optimization level. $level is a number from 1 to 9.$myref = $h->data()Returns the current HTML data as a scalar reference.strip(\%options);Removes excess space from HTMLYou can control the optimizations used by specifying them in the %options hash reference. The following options are recognized:
compat()This function improves the cross-platform compatibility of your HTML. Currently checks for the following problems:
defrontpage();This function converts pages created with Microsoft Frontpage to something a Unix server will understand a bit better. This function currently does the following:
SEE ALSOModulesFrontPage::Web, FrontPage::FileWeb Sites
AUTHORS and CO-AUTHORSPaul Lindner for the International Telecommunication Union (ITU)Pavel Kuptsov <admin@modernperl.ru> COPYRIGHTThe HTML::Strip module is Copyright (c) 1998,99 by the ITU, Geneva Switzerland. All rights reserved.You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
Visit the GSP FreeBSD Man Page Interface. |