in reply to How to validate HTML?

Hi rose, the best option for manipulating HTML data is through using modules. Try these...

HTML::Parser HTML::SimpleParse HTML::TagParser
One of this should really solve your purpose.