#!/usr/bin/perl use strict; use warnings; use HTML::TokeParser::Simple; my $p = HTML::TokeParser::Simple->new(*DATA); my ($html, $in_email_link); while (my $t = $p->get_token){ $in_email_link++, next if $t->is_start_tag(q{a}) and $t->get_attr(q{href}) and $t->get_attr(q{href}) =~ m|email\.|; $in_email_link--, next if $in_email_link and $t->is_end_tag(q{a}); next if $in_email_link; $html .= $t->as_is; } print qq{$html}; __DATA__

one

Next Page

two

E-mail Story

three

Next Page