Mj1234 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I have a string with html tags as shown below.

<style>table{border-collapse: collapse;margin-left: 1cm;font-Family: c +ourier;width: 60%} \.hoverTable tr{background: #D8D8D8;} \.hoverTable + tr:hover{background-color: #ffff99; } </style><table border=2 class=\"hoverTable\"><tr><td bgcol +or=\"#366092\" width=\"18%\"><font color=\"White\">Name</font></td><t +d><b>ABC</b></td></tr><tr> <td bgcolor=\"#366092\" width=\"18%\"><font color=\"White\ +">Subject</font></td><td><b>XYZ</b></td></tr></table>

How can I remove the html content and retain only the plain text using HTML::Parser?

Replies are listed 'Best First'.
Re: Strip html from string using perl
by haukex (Archbishop) on Jul 29, 2016 at 06:37 UTC