1 package Config::Any::YAML;
6 use base 'Config::Any::Base';
10 Config::Any::YAML - Load YAML config files
14 Loads YAML files. Example:
28 return an array of valid extensions (C<yml>, C<yaml>).
33 return qw( yml yaml );
38 Attempts to load C<$file> as a YAML file.
46 eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) };
49 return YAML::LoadFile( $file );
52 open( my $fh, $file ) or die $!;
53 my $content = do { local $/; <$fh> };
55 return YAML::Syck::Load( $content );
59 =head2 requires_any_of( )
61 Specifies that this modules requires one of L<YAML::Syck> (0.70) or L<YAML> in
66 sub requires_any_of { [ 'YAML::Syck', '0.70' ], 'YAML' }
70 Brian Cassidy E<lt>bricas@cpan.orgE<gt>
72 =head1 COPYRIGHT AND LICENSE
74 Copyright 2007 by Brian Cassidy
76 This library is free software; you can redistribute it and/or modify
77 it under the same terms as Perl itself.
85 =item * L<Config::Any>