in reply to More efficient use of HTML::TokeParser::Simple
You might want to try HTML::PullParser as an alternative. You associate an argspec with an event that you want. Then this will return the next token found: $token = $p->get_token Then try $p->unget_token( @tokens ) This will push back the tokens, but they'll be returned the next time $p->get_token is called. I hope this helps you.