On Dec 13, 2005, at 5:59, Durai raj wrote:
I tried to remove white space and newlines from HTML pages using
HTML::Strip::Whitespace module. It removes the white space, but not
NEW LINES.
Here is my script:
====================
use HTML::Strip::Whitespace qw(html_strip_whitespace);
my $html = q {
<html>
<body>
<p>
Hello there!
</p>
</body>
</html>
};
my $buffer = "";
html_strip_whitespace(
'source' => \$html,
'out' => \$buffer,
'strip_newlines' => 1
);
print $buffer;
================================
I've read the source code and looks like the module does not
implement strip_newlines. That option is certainly understood, but it
is not used AFAICT.
Note that strip_newlines is NOT documented, maybe the author is going
to do something with it in a future and left a partial and private
thing there. Since it is not documented you wouldn't rely on it,
neither expect it to do anything in particular.
In addition, a newline in itself is significant whitespace (it
renders as a space), the module is meant to remove whitespace that is
redundant.
-- fxn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>