#!/usr/bin/perl use strict; use warnings; use HTML::TokeParser::Simple; my $html; { local $/; $html = ; } my $p = HTML::TokeParser::Simple->new(\$html); my (@content, $in_bq); my $font_tag = 0; while (my $t = $p->get_token){ $in_bq++, next if $t->is_start_tag('blockquote'); next unless $in_bq; $font_tag++, next if $t->is_start_tag('font'); push @content, $t->as_is if $t->is_text and $font_tag == 2; ($in_bq, $font_tag) = (0,0) if $font_tag == 2; } print "@content"; __DATA__
code
all other text and stuff goes here
code
all other text and stuff goes here