in reply to Parsing Mason tags like HTML tags?

If regex is not good enough for you (sounds like it should be), maybe you can replace the mason tags (in memory) by an innocent html tag, and run through the HTML::Parser? just a thought.