sub strip_a_elements { my $t = HTML::TreeBuilder->new_from_content( $_[0] ); $_->replace_with_content for $t->find_by_tag_name('a'); $t->as_HTML }