use strict; my @testStrs = ("all this
", "meh!"); for my $str (@testStrs) { my $contents = $str; $contents =~ s/^[^## After: "" Before: "all this" After: "meh!" Before: "meh!" #### use strict; use warnings; use HTML::TreeBuilder; my $htmlFrag = ("
All good men
"); my $root = HTML::TreeBuilder->new_from_content($htmlFrag)->elementify(); my $form = $root->look_down("_tag", "form"); print $form->as_text(); ##
## All good men