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=3213128d43e47050a3c731005b4ef6b3c8861c9d;hp=18b201f75cd51e89d1690459792d70c0379e24a3;hb=72628dc786ef43d546023d6f17a86c3f5edeb21a;hpb=a918b0b8b7952db918dfabb8dc72bf34832d43d0 diff --git a/lib/Config/Any/JSON.pm b/lib/Config/Any/JSON.pm index 18b201f..3213128 100644 --- a/lib/Config/Any/JSON.pm +++ b/lib/Config/Any/JSON.pm @@ -57,6 +57,19 @@ sub load { } } +=head2 is_supported( ) + +Returns true if either L or L is available. + +=cut + +sub is_supported { + eval { require JSON::Syck; }; + return 1 unless $@; + eval { require JSON; }; + return $@ ? 0 : 1; +} + =head1 AUTHOR Brian Cassidy Ebricas@cpan.orgE