http://qs321.pair.com?node_id=11106822


in reply to Re^4: Truncating an HTML node using XPaths in HTML::TreeBuilder::XPath
in thread Truncating an HTML node using XPaths in HTML::TreeBuilder::XPath

You can test each item in content_list to see if it is a <br> tag:
for my $d ($root->findnodes($xpath)) { my @line = $d->content_list; my @truncated; for my $line (@line) { if (ref $line) { last if $line->tag eq 'br'; } push(@truncated,$line); } $d->replace_with(@truncated); }