in reply to Fastest way of XML -> perl structure

What are you actually trying to accomplish? As best I can tell, one of the biggest problems with XML parsing is that - because it's tag matched - you end up having to read the whole doc into memory before you can even start.

If I'm after speed, I often find an incremental parsing approach using XML::Twig works quite well, because you can fire twig handlers and purge the data structure as you go.

  • Comment on Re: Fastest way of XML -> perl structure

Replies are listed 'Best First'.
Re^2: Fastest way of XML -> perl structure
by choroba (Cardinal) on Mar 20, 2017 at 22:19 UTC
    > you end up having to read the whole doc into memory before you can even start

    Interesting. How did they contrive XML::SAX or XML::LibXML::Reader ?

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,