Hi all, I would like to know if there is any freeware Perl code out there, similar to the PHP powerful function: strip_tags.
What I am needing is to strip HTML tags from email bodies. I have a Perl program that process emails that have been working for many years, but the HTML format in some email messages, is affecting other applications.
##############################
use HTML::TreeBuilder;
use HTML::FormatText;
my $s; # the text out of which you wish to strip HTML
my $formatter = HTML::FormatText->new;
my $tree = HTML::TreeBuilder->new;
$tree->parse($s);
if ($tree) {
$formatter->format($tree);
$tree->delete; # DO NOT OMIT THIS STEP!
}
##############################