X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FConfigLoader%2FYAML.pm;h=f1e6a866af9410566d7ae198a52de8d52850e426;hb=b773e0786fdcf35af131fc795b2df4fcc85e4e8b;hp=e16bce1a79a41e71de27fc5af2985205255f8108;hpb=9742697f231e785f5da1aa2484d43c5f0e22239b;p=catagits%2FCatalyst-Plugin-ConfigLoader.git diff --git a/lib/Catalyst/Plugin/ConfigLoader/YAML.pm b/lib/Catalyst/Plugin/ConfigLoader/YAML.pm index e16bce1..f1e6a86 100644 --- a/lib/Catalyst/Plugin/ConfigLoader/YAML.pm +++ b/lib/Catalyst/Plugin/ConfigLoader/YAML.pm @@ -3,8 +3,6 @@ package Catalyst::Plugin::ConfigLoader::YAML; use strict; use warnings; -#use File::Slurp; - =head1 NAME Catalyst::Plugin::ConfigLoader::YAML - Load YAML config files @@ -17,6 +15,9 @@ Loads YAML files. Example: name: TestApp Controller::Foo: foo: bar + Model::Baz: + qux: xyzzy + =head1 METHODS @@ -46,7 +47,9 @@ sub load { return YAML::LoadFile( $file ); } else { - my $content = read_file( $file ); + open( my $fh, $file ) or die $!; + my $content = do { local $/; <$fh> }; + close $fh; return YAML::Syck::Load( $content ); } } @@ -74,6 +77,10 @@ it under the same terms as Perl itself. =item * L +=item * L + +=item * L + =back =cut