in reply to Re: tgrep - A grep for XML/HTML tags
in thread tgrep - A grep for HTML tags

:-)

You're quite correct. I'll add appropriate disclaimers to the code.

It doesn't use the XML modules for two reasons. One reasonable, one not:

  1. The script had its origins in some perl4 code I wrote in the mid-nineties. I've only ever changed it when it's not done what I wanted (I know, I should refactor more :-)

  2. I use it mostly for dealing with HTML. Broken HTML at that.

It does what I need it to do. You're right about it not handling XML properly. I guess I've internalised the limitations of tgrep and know when to use it and when to write some XSLT (or whatever).

There's probably a lesson in that for me.