From: lestrrat Date: Wed, 4 Nov 2009 08:36:26 +0000 (+0900) Subject: move use_ext before the extra args X-Git-Tag: 0.04~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3af8baefdf88e828cca1ff5b6376e3aa151dce32;hp=392e82e0852e5968030e979790001e9c1b9f1bf5;p=gitmo%2FMooseX-SimpleConfig.git move use_ext before the extra args --- diff --git a/lib/MooseX/SimpleConfig.pm b/lib/MooseX/SimpleConfig.pm index e3ad86c..056bdfd 100644 --- a/lib/MooseX/SimpleConfig.pm +++ b/lib/MooseX/SimpleConfig.pm @@ -11,11 +11,14 @@ sub get_config_from_file { my ($class, $file) = @_; my $can_config_any_args = $class->can('config_any_args'); - my %args = $can_config_any_args ? - ( %{$can_config_any_args->($class, $file)}, files => [ $file ], use_ext => 1 ) : - ( files => [ $file ], use_ext => 1 ) + my $extra_args = $can_config_any_args ? + $can_config_any_args->($class, $file) : {}; ; - my $raw_cfany = Config::Any->load_files(\%args); + my $raw_cfany = Config::Any->load_files({ + use_ext => 1, + %$extra_args, + files => [ $file ] + } ); die q{Specified configfile '} . $file . q{' does not exist, is empty, or is not readable}