in reply to OO style question: how much information to hide?
I'd say that being able to write simpler code is a win. So:
- Don't die nor warn (by default) on "deleting" a non-existant tag (even if there is some reason that it should be "impossible" for the tag to exist, such as the token being an end tag)
- Have the "delete" method return what was deleted (just like delete does)
- Have "add attribute" complain for end tags
In Section
Seekers of Perl Wisdom