1 package Config::Any::JSON;
8 Config::Any::JSON - Load JSON config files
12 Loads JSON files. Example:
28 return an array of valid extensions (C<json>, C<jsn>).
33 return qw( json jsn );
38 Attempts to load C<$file> as a JSON file.
46 open( my $fh, $file ) or die $!;
47 my $content = do { local $/; <$fh> };
50 eval { require JSON::Syck; };
53 return JSON::jsonToObj( $content );
56 return JSON::Syck::Load( $content );
62 Brian Cassidy E<lt>bricas@cpan.orgE<gt>
64 =head1 COPYRIGHT AND LICENSE
66 Copyright 2007 by Brian Cassidy
68 This library is free software; you can redistribute it and/or modify
69 it under the same terms as Perl itself.
77 =item * L<Config::Any>