Mojo::DOM should have a ->remove method
At this point, some bright person will probably comment that "Butbutbut you can like use ->replace for that". Yes, I know, but there's a difference. Imagine implementing a CRUD interface to a database and skipping the D because it can be implemented by passing an empty document to U. How would that feel to you? Perhaps a bit inelegant? That's the same feeling people get when looking at using ->replace to delete data, albeit on a somewhat smaller scale.
I'm neutral on this, both arguments make sense.
+1
-1
Changing my vote since i don't like the inconsistency between $dom->remove and $dom->replace_content('').
I like ->remove because it's obvious when that's what your intent is. Is there really a high maintenance cost to an additional subroutine? Seems like something that would require almost no effort after it's initially written.
There sure is additional maintenance cost, for example all new tests for $dom->replace('') will have to be written twice.
Does remove have to be any more than a call to $dom->replace('')?
Nope, not at the moment.
-1 from me as well, agree with @kraih
I'm afraid this proposal has been rejected by majority vote.
Testing this feature atm., not sure if it will stay though. https://github.com/kraih/mojo/commit/ec77b0ee7c349643d686e56b107d9364a3697829