in reply to file parsing

Well, dragonchild suggests HTML::Parser because it sounds like HTML. However, with that <&xml version... at the beginning, it sounds like it's actually XML (or, more specifically, probably XHTML). While HTML::Parser would probably do the job, so would XML::Twig. I suspect, though I've never used HTML::Parser, that XML::Twig is probably a bit more difficult to learn. That said, it seems to be a tool in my toolbox that I keep coming back to, time and again. I can use it for general XML as well as for XHTML processing. And I do both. In that way, it's nice to have such a general tool that is so usable and so reliable as a tool. Any excuse to learn this module is likely to come back and pay for itself many times over.

I'm not saying that learning HTML::Parser is a waste of time. Only that XML::Twig is more general and so probably even more worth the time investment.