while( $token = $stream->get_token) { if ($token->[0] eq 'S' and $token->[1] eq 'div' and ($token->[2]{'class'} || '') eq 'text12') { $description = $stream->get_trimmed_text('/div'); $num = length($description); if ($num > 200) { print "$description

"; } } }