Hi,
Thanks for the reply. Is there any other perl modules or tools available to
remove the white space in HTML and JavaScript pages?
Thanks,
Durai
Xavier Noria <[EMAIL PROTECTED]> wrote: 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 {
>
>
>
>
> Hello there!
>
>
>
> };
> 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]
---------------------------------
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping