1 package Config::Any::YAML;
8 Config::Any::YAML - Load YAML config files
12 Loads YAML files. Example:
26 return an array of valid extensions (C<yml>, C<yaml>).
31 return qw( yml yaml );
36 Attempts to load C<$file> as a YAML file.
44 eval { require YAML::Syck; };
47 return YAML::LoadFile( $file );
50 open( my $fh, $file ) or die $!;
51 my $content = do { local $/; <$fh> };
53 return YAML::Syck::Load( $content );
57 =head2 is_supported( )
59 Returns true if either L<YAML::Syck> or L<YAML> is available.
64 eval { require YAML::Syck; };
66 eval { require YAML; };
72 Brian Cassidy E<lt>bricas@cpan.orgE<gt>
74 =head1 COPYRIGHT AND LICENSE
76 Copyright 2007 by Brian Cassidy
78 This library is free software; you can redistribute it and/or modify
79 it under the same terms as Perl itself.
87 =item * L<Config::Any>