Perl and XML parsing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bok999
    New Member
    • May 2007
    • 1

    Perl and XML parsing

    I have a fairly large perl script with many sections I've been using for years which parses some XML and inserts the data to mysql. Unfortunately the xml interpreter put the whole file into memory and parsed it and as the files are getting upwards of 500Mb now that's getting slow...so I started rewriting using XML::Parser::Pe rlSAX which seems to be much better..

    However the problem I have is that the implementation of it is as an inline package. I can't call my already established subroutines from inside the package. Is it possible at all ?

    Example of package is at http://www.xml.com/lpt/a/728

    Or can this be done not as a package.. Sorry I've never worked with inline packages before so this all might seem stupid..

    Regards

    Bok
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    For XML files of that size, the best module that I've found is actually XML::Twig

    http://xmltwig.com/

    Unfortunately, there appears to be quite a learning curve when attempting to use any new Perl XML modules, but I believe that this one might be what you need. Give it a look.

    - Miller

    Comment

    Working...