If that's your entire text, it's not well-formed. I wouldn't expect a parser to work correctly on a snippet like that. I know that HTML::Parser (on which HTML::TokeParser is based) insists on delivering well-matched pairs of start and end tags. I talk about that in a couple of my columns.