My way probably isn't the best for this task, but I always use HTML::TokeParser::Simple.
The idiom is:
while ( my $t = $p->get_token )
{
if ( $t->is_start_tag('b') )
{
while ( my $t = $p->get_token )
{
last if $t->is_end_tag('/b');
if ( $t->is_text )
The simple while ( get_new_token ) if ( what_i_want ) while ( get_new_token ) last if ( the_end_of_what_i_want ), makes things very easy even if slightly tedious. Very SAXish
Evan Carroll
www.EvanCarroll.com