in reply to How to run multiple xml in a directory on a single perl script

Hi Siegfried_13,
..seek helpon how to parse multiple xml files from a directory using a single perl script...

There are two suggestion I can give here:

  1. Never parse XML using a regex. There are several modules you could use like XML::LibXML and the likes
  2. Since, all the xml files are in the same directory, and there are no sub-directories to check for xml files. Simply, use opendir, readdir get the files ending with .xml and using a for-loop or a while-loop as the case may be.
    I know taint had mentioned using a File::Find, but for me, it will be like killing an ant with a sledged hammer

All of these can be done in a single perl script.
Hope this helps.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
  • Comment on Re: How to run multiple xml in a directory on a single perl script

Replies are listed 'Best First'.
Re^2: How to run multiple xml in a directory on a single perl script
by taint (Chaplain) on Jun 03, 2014 at 12:15 UTC
    @2teez:

    Your comment about File::Find may have some merit right now. But my suggestion makes his script FutureProof. Who's to say how many (sub)directories will be used tomorrow, or {...}?
    ++ to you anyway. :)

    --Chris

    ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

      taint,
      ..But my suggestion makes his script FutureProof..
      I agree, but who knows when? More so, can we take the step to the future one at a time? *wink* ;)

      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me