Help for this page
use feature 'say'; use Mojo::DOM; ... my $dom = Mojo::DOM->new( $html ); say $dom->at('html html')->child_nodes->first->remove;
<html><head> <script>/*some embedded document*/</script> ... <p>this is a second test</p> </body> </html>