X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=lib%2FConfig%2FAny%2FJSON.pm;h=81cbaf898ad869a1e86b287b30148e0e783698ed;hp=785f3968b8f05c6e1646c37756de0c74e95e45f4;hb=837fdc4c1b81b0032be8cf1c06e0a13f4e153133;hpb=3a27e96d3f96ae99fa6bc1a78ec420b0a6392f0d diff --git a/lib/Config/Any/JSON.pm b/lib/Config/Any/JSON.pm index 785f396..81cbaf8 100644 --- a/lib/Config/Any/JSON.pm +++ b/lib/Config/Any/JSON.pm @@ -50,7 +50,15 @@ sub load { my $content = do { local $/; <$fh> }; close $fh; - if ( eval { require JSON::DWIW } ) { + if ( eval { require Cpanel::JSON::XS } ) { + my $decoder = Cpanel::JSON::XS->new->utf8->relaxed; + return $decoder->decode( $content ); + } + elsif ( eval { require JSON::MaybeXS } ) { + my $decoder = JSON::MaybeXS::JSON()->new->utf8->relaxed; + return $decoder->decode( $content ); + } + elsif ( eval { require JSON::DWIW } ) { my $decoder = JSON::DWIW->new; my ( $data, $error ) = $decoder->from_json( $content ); die $error if $error;