Check in CPAN, I think that there is some module in the B or Devel namespace that outputs an XML version of your code after compiling it; you can then write a stylesheet to transform it into HTML and you would be sure that the parsing is proper because it has been done by perl itself.
Originally posted as a Categorized Answer.