From: Brian Cassidy Date: Thu, 8 Nov 2007 16:21:13 +0000 (+0000) Subject: more code updates, before i look in depth at the _load() routine X-Git-Tag: v0.09_01~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=commitdiff_plain;h=7c2181827882c125de98ccbe16402f5b277a3f44;hp=bef9e9a56024f417b4aa09120378d8c5d31137bc more code updates, before i look in depth at the _load() routine --- diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index 856d616..07f7a9c 100644 --- a/lib/Config/Any.pm +++ b/lib/Config/Any.pm @@ -5,7 +5,6 @@ use warnings; use Carp; use Module::Pluggable::Object (); -use English qw(-no_match_vars); our $VERSION = '0.09'; @@ -15,7 +14,7 @@ Config::Any - Load configuration from different file formats, transparently =head1 VERSION -This document describes Config::Any version 0.0.8 +This document describes Config::Any version 0.09 =head1 SYNOPSIS @@ -49,7 +48,7 @@ configuration formats. =cut -=head2 load_files( ) +=head2 load_files( \%args ) Config::Any->load_files( { files => \@files } ); Config::Any->load_files( { files => \@files, filter => \&filter } ); @@ -95,7 +94,7 @@ sub load_files { return $class->_load( $args ); } -=head2 load_stems( ) +=head2 load_stems( \%args ) Config::Any->load_stems( { stems => \@stems } ); Config::Any->load_stems( { stems => \@stems, filter => \&filter } ); @@ -141,7 +140,7 @@ sub _load { my %files = map { $_ => 1 } @$files_ref; my %force_plugins = map { $_ => 1 } @$force_plugins_ref; - my $enforcing = keys %force_plugins ? 1 : 0; + my $enforcing = keys %force_plugins ? 1 : 0; my $final_configs = []; my $originally_loaded = {}; @@ -176,7 +175,7 @@ sub _load { my $config; eval { $config = $loader->load( $filename, $driver_args ); }; - next if $EVAL_ERROR; # if it croaked or warned, we can't use it + next if $@; # if it croaked or warned, we can't use it next if !$config; delete $files{ $filename }; @@ -186,7 +185,8 @@ sub _load { push @$final_configs, { $filename => $config }; } } - $final_configs; + + return $final_configs; } =head2 finder( ) @@ -237,7 +237,7 @@ sub extensions { =over -=item C or C +=item C or C The C and C methods will issue this warning if called with an empty list of files/stems to load.