my %verb = (S => 4, # start tag E => 2, # end tag T => 1, # text element C => 1, # comment D => 1, # declaration PI => 2); # processing instruction my $p = HTML::TokeParser->new(\$$cleaned); my $nff_content; # No Font face content while( my $t = $p->get_token ) { if ($t->[0] eq 'S' and $t->[1] eq 'font') { my $attr = $t->[2]; delete $attr->{face}; my $attributes = join(" ", map {qq{$_="$attr->{$_}"}} keys %$attr); $nff_content .= ""; } else { $nff_content .= $t->[$verb{ $t->[0]}]; } }