, it's very unlikely that you'll have ANY broken tags. Anyway, you're right about the debugging. First, I would check what's wrong with the HTML source, THEN go to the perl and isolate the problem. Of course, if you can eliminate broken tags AND misspelled attributes, then you're debugging woes are kept to a minimum.