Changing if($list->is_empty) to if(!$list->is_empty) should do it.
Edit: Thanks to a tangent's answer I realised I misunderstood what you meant by "empty", as in "empty content", please ignore what I posted. Your script works for me, it deletes empty-content li items.
In reply to Re: Deleting nodes with HTML::TreeBuilder::XPath
by bliako
in thread Deleting nodes with HTML::TreeBuilder::XPath
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |