Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yanick committed Jul 25, 2014
1 parent e341889 commit aee46c3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/Dancer/Config.pm
Expand Up @@ -225,12 +225,8 @@ sub load {
sub load_settings_from_yaml {
my ($file) = @_;

my $config;

eval { $config = YAML::LoadFile($file) };
if (my $err = $@ || (!$config)) {
confess "Unable to parse the configuration file: $file: $@";
}
my $config = eval { YAML::LoadFile($file) }
or confess "Unable to parse the configuration file: $file: $@";

# groom the values of $config
while( my ($k,$v) = each %$config ) {
Expand All @@ -239,7 +235,7 @@ sub load_settings_from_yaml {

$SETTINGS = Hash::Merge::Simple::merge( $SETTINGS, $config );

return scalar(keys %$config);
return scalar keys %$config;
}

sub load_default_settings {
Expand Down

0 comments on commit aee46c3

Please sign in to comment.