Almost, not quite. Need this:
# strips a specific tag from string
sub eliminate_tags {
my ($page, $tag) = @_;
my $dom = Mojo::DOM->new;
foreach my $b ($dom->parse($page)->find($tag)->each) {
$b->remove
}
return $dom;
}
So my beef it that: 1) I'd have to be familiar enough with Mojo::Dom to figure out it could do this (I'm not) so I needed to come PerlMonks to find someone like you to help and 2) I have to spend 20 min. wading through monstrous documentation to figure out how to use it for something simple.
So why isn't a specific tool better than a general purpose tool? You're saying a specific tool is inferior because it has more dependencies?