white space cleanups
[p5sagit/Config-Any.git] / lib / Config / Any / JSON.pm
index 785f396..91d1531 100644 (file)
@@ -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;
@@ -95,11 +103,11 @@ Brian Cassidy E<lt>bricas@cpan.orgE<gt>
 Copyright 2006-2016 by Brian Cassidy
 
 This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself. 
+it under the same terms as Perl itself.
 
 =head1 SEE ALSO
 
-=over 4 
+=over 4
 
 =item * L<Catalyst>