Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Fastest XML Parser ?

by toolic (Bishop)
on Dec 10, 2015 at 02:36 UTC ( [id://1149859]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Fastest XML Parser ?
in thread Fastest XML Parser ?

I agree that the docs could be clearer. Setting this variable causes code to die badly if the fast module is not installed.

Here is code that I use to check if the fast module is installed. If it is installed, the code is happy, and it just uses the fast module. If it is not installed, it quietly falls back to the slow module:

use English qw($CHILD_ERROR); use XML::Simple; # If a fast parser for XML::Simple is installed, then use it. my $parser = 'XML::LibXML::SAX'; my $cmd = "perl -M$parser -e 1"; my $output = qx($cmd 2>&1); unless ($CHILD_ERROR) { $XML::Simple::PREFERRED_PARSER = $parser; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1149859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-19 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found