--- trunk/lib/Frey/Config.pm 2008/11/01 13:17:45 229 +++ trunk/lib/Frey/Config.pm 2008/11/09 10:54:30 342 @@ -33,6 +33,8 @@ our %config; +sub debug { 1 }; + sub load_config { my $self = shift; foreach my $name ( 'config', 'site_config', ref($self), @_ ) { @@ -43,13 +45,13 @@ } else { %config = %{ merge( LoadFile($path) , \%config ) } if -e $path; } - warn "## $path current config = ",dump( %config ) if $self->debug; + warn "## load_config $path current config = ",dump( %config ) if $self->debug; } } sub config { - my $self = shift; - my $key = shift || ref($self); + my ( $self, $key ) = @_; + $key ||= ref($self); warn "## config $key" if $self->debug; $self->load_config unless defined %config; #confess "$key doesn't exist in config" unless defined $config{ $key };