use Mojo::DOM; my $dom = Mojo::DOM->new('
Paragraph one here.
Paragraph two here.'); for my $e ( $dom->find('p')->each ) { print $e->text,$/; } ### Output: # Paragraph one here. # Paragraph here. #