use strict; use warnings; use HTML::TreeBuilder; my $str = "" ; # Now create a new tree to parse the HTML from String $str my $tr = HTML::TreeBuilder->new_from_content($str); # And now find all
  • tags and create an array with the values. my @lists = map { $_->content_list } $tr->find_by_tag_name('span'); # And loop through the array returning our values. foreach my $sentence (@lists) { $sentence =~ s/Spoken/SUBSTITUTION/; print $sentence, "\n"; }