in reply to Brief question: m// and nested HTML tags
I would try a CPAN module like HTML::Tree.
non-Perl: Andy Ford