use strict; use warnings; use HTML::Treebuilder; my $html = '

Blah

 

 

Blah

'; my $element_root = HTML::TreeBuilder->new_from_content($html); my $body = $element_root->look_down( _tag => "body"); $body->dump; print "\n"; $body->splice_content(1,2); $body->dump;