in reply to how to eliminate all html tags in a given string ??
Take a look at HTML::TreeBuilder and the element method as_text.
use warnings; use strict; use HTML::TreeBuilder; my $string= " <html><head> i am sugar <br> smartest guy in the world < +br> </head></html>"; my $tree = HTML::TreeBuilder->new; $tree->parse ($string); print $tree->as_text ();
Prints:
i am sugar smartest guy in the world
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to eliminate all html tags in a given string ??
by jdporter (Paladin) on Nov 24, 2005 at 17:50 UTC |