X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=lib%2FConfig%2FAny%2FYAML.pm;h=31f0e8a66cc9db49f448cb0d6b0c8d560676d2c1;hp=46e4d1eb6a84effd9d53b44d7a485aa38d29d54c;hb=4198bf8c36c5f90c71845bd2505d953d3422037e;hpb=92a04e78451078b33f75e7c44d247b024c27b4f7 diff --git a/lib/Config/Any/YAML.pm b/lib/Config/Any/YAML.pm index 46e4d1e..31f0e8a 100644 --- a/lib/Config/Any/YAML.pm +++ b/lib/Config/Any/YAML.pm @@ -41,7 +41,7 @@ sub load { my $class = shift; my $file = shift; - eval { require YAML::Syck; }; + eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) }; if ( $@ ) { require YAML; return YAML::LoadFile( $file ); @@ -54,17 +54,26 @@ sub load { } } -=head1 AUTHOR +=head2 is_supported( ) -=over 4 +Returns true if either L or L is available. -=item * Brian Cassidy Ebricas@cpan.orgE +=cut -=back +sub is_supported { + eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) }; + return 1 unless $@; + eval { require YAML; }; + return $@ ? 0 : 1; +} + +=head1 AUTHOR + +Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Brian Cassidy +Copyright 2007 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.