To answer my own question, using reverse seems to fix the problem:
for my $p ($elt->children('p')) { for my $c (reverse($p->cut_children())) { $c->paste($elt); } $p->delete(); }
I don't understand why it's needed, but it works.
In reply to Re^3: XML::Twig removing tags from content (XML::Twig)
by slugger415
in thread XML::Twig removing tags from content
by slugger415
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |