in reply to Re: parsing a simple xml response
in thread parsing a simple xml response

Actually, looks like XML::Simple is not shorter.

Of course it is. my $xml = XMLin( ... ); No one but you would bother to wrap it up in all that unnecessary verbiage.

It's just slower and more fragile.

I wonder. How much less time than 0.2 seconds (0.4 if we include the time taken to load perl and the libraries) does LibXML take?

And given this is being read back from a website, will it make a Gnat's cock of difference?

c:\test>timeit \perl64\bin\perl.exe junk4.pl Took 0.168277 seconds { ano => 22222222, cn => "1111222233334444555", custid => 101010101, description => "Transfer Completed", kf => {}, neta => "7.00", prid => "X111111111111111", responsecode => 11, status => "success", trxid => 33333333, } Took: 0.381164000 seconds

After XML::Simple, there's only one other XML::* module worth considering. XML::Twig. Because it's the only one that will deal effectively with bigger than memory XML files.

And before you respond, realise that any sentence that start with "If...", doesn't mean damn thing.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^3: parsing a simple xml response
by ikegami (Patriarch) on Jul 07, 2010 at 15:36 UTC

    No one but you would bother to wrap it up in all that unnecessary verbiage.

    PREFERRED_PARSER ensures XML::Parser is used. It's *by far* the fastest backend for XML::Simple.

    And given this is being read back from a website, will it make a Gnat's cock of difference?

    Seriously? You're complaining that I gave a faster alternative? Had it come of at the cost of code readability or extra work, that would have been worth pointing out.

    The difference is significant where I use it (and yes, we pull the response from the web).