in reply to Re^2: Fastest XML Parser ?
in thread Fastest XML Parser ?
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; }
|
|---|