Contrary to popular belief, wrapping a call to XML:Parser in an eval, provided it's a block eval, is completely kosher and does not inflict a huge (or actually any) performance penalty. In any case the actual parsing takes much longer than eval-ing a short string even if you choose to use the string version of eval. You can have a look at the review for a way to do this.
Now if you are trying to check tons of files you might want to use James Clarke sp. James Clarke is the guy who wrote the expat library on which XML::Parser is based. He also wrote part of XML-the-spec, groff and way to many things for me to list here... The interesting part is that sp is an SGML parser, which means that you will have to set a couple of environment variables to get it to parse XML (quite easy to do) but also that it will not stop at the first error in the file an try its best to find other errors. It will also probably be faster than using XML::Parser.
In reply to Re: well formed xml
by mirod
in thread well formed xml
by marvell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |