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' ) };
48 open( my $fh, $file ) or die $!;
49 my $content = do { local $/; <$fh> };
51 return YAML::Syck::Load( $content );
55 return YAML::LoadFile( $file );
58 =head2 requires_any_of( )
60 Specifies that this modules requires one of L<YAML::Syck> (0.70) or L<YAML> in
65 sub requires_any_of { [ 'YAML::Syck', '0.70' ], 'YAML' }
69 Brian Cassidy E<lt>bricas@cpan.orgE<gt>
71 =head1 COPYRIGHT AND LICENSE
73 Copyright 2007 by Brian Cassidy
75 This library is free software; you can redistribute it and/or modify
76 it under the same terms as Perl itself.
84 =item * L<Config::Any>