in reply to Iteration condition...

I would reevaluate your strategy considering those seemingly simple regexes could actually be quite nasty.

For example, what is the start of an html tag? Is it '<'? What is the close? Is it '>'? The answer to both questions is not always:
$html_tag = '<img src="img.png" alt="peg leg > with a kickstand">';
Is a single valid html tag. To accurately describe and manipulate html with regular expressions, one would want something like:
my $x = SOME_HTML; while($x =~ /\G(.*?)(<(?:"[^"]*"|'[^']*'|[^'">])*>)/gcs){ do_something_with_text($1); do_something_with_tag($2); }
Which could be packaged as an iterator.