XP is just a number | |
PerlMonks |
How to use HTML::Parser to encode text with HTML entities?by locust (Sexton) |
on Dec 01, 2010 at 17:49 UTC ( [id://874701]=perlquestion: print w/replies, xml ) | Need Help?? |
locust has asked for the wisdom of the Perl Monks concerning the following question: Hey Monks! I have a string that contains an HTML file. What I'd like to do is first decode any HTML entities contained in the text (only!) and then encode the text with entities that I can specify. What I want returned is the entire string, in the same order that it was in, with just the text encoded with HTML entities. I have assumed that using a combination of HTML::Parser and HTML::Entities is the best way to achieve my goal, but if you have a better way, then let me here it Anyhow, anyone know how to do this? I don't have much experience with HTML::Parser, and the documentation is not really clear to me on how to do this. Thanks Update I used the HTML::TokeParser::Simple module and HTML::Entities to get the solution:
Thanks!
Back to
Seekers of Perl Wisdom
|
|