On Sun, Aug 3, 2008 at 9:30 AM, Daniel McBrearty <[EMAIL PROTECTED]> wrote: > wait, it is on $self not $c, so my reservations don't really apply. > > but what about reall config stuff that can change from one > installation to another? then you have to do $c->config->{my_var}, > right?
It's all merged properly if you use ConfigLoader. In your MyApp.pm if you have: __PACKAGE__->config( 'Model::Foo' => { bar => 'baz' } ); And in MyApp/Model/Foo.pm you have: __PACKAGE__->config( bar => 'foo' ); If you have a method in Model::Foo, $self->{bar} will be equal to 'baz'. The order is always Component -> App -> External Conf. External Conf has other orders, but that's another email. You never want to use $c->config because $c->config->{'Model::Foo'} should, and in most cases will, be equal to $self->{...} config keys, you aren't guaranteed that. You are, however, guaranteed that $self->{...} keys are populated from config after component construction (component time, I believe) (mst, feel free to correct me if I got any points wrong :)) _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/