in reply to How to run multiple xml in a directory on a single perl script
Definitely use an XML processing library in Perl to do all of the work involved in parsing the XML files. I most-often use XML::LibXML because it uses a very commonly-used XML processing library, such that your program might well be reading the file using the same software that the client used to produce it.
Don’t overlook the possibility of running your Perl program from the command-line with a parameter such as somedir/*.xml, or something along those lines, which would invoke your program multiple times passing one file at a time to it as a command-line parameter. Another way to do it, but sometimes a very useful one.