<div dir="ltr"><div>I'm confused about this rather stern note in Catalyst.pm.</div><div><br></div><div>Is this the following wrapper related to the text in the NOTE?</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>B<NOTE:> you MUST NOT call C<< $self->config >> or C<< __PACKAGE__->config >></div></div><div><div>as a way of reading config within your code, as this B<will not> give you the</div></div><div><div>correctly merged config back. You B<MUST> take the config values supplied to</div></div><div><div>the constructor and use those instead.</div></div><div><div><br></div></div><div><div>=cut</div></div><div><div><br></div></div><div><div>around config => sub {</div></div><div><div> my $orig = shift;</div></div><div><div> my $c = shift;</div></div><div><div><br></div></div><div><div> croak('Setting config after setup has been run is not allowed.')</div></div><div><div> if ( @_ and $c->setup_finished );</div></div><div><div><br></div></div><div><div> $c->$orig(@_);</div></div><div><div>};</div></div></blockquote><div><br></div><div>I understand the NOTE for Model/View/Controllers where the component's __PACKAGE__->config is merged in with the application config for that component. Calling $self->config won't be the same thing passed to the component's constructor.</div><div><br></div><div>But, what's the issue with calling $c->config( foo => 123 ) at runtime? Or even $c->config( \%new_config )? </div><div><br></div><div>Note that wrapper only applies to calling config on the app class, and does not apply to Model/View/Controllers.</div><div><br></div><div>Is there some other issues I'm missing? What problem is that wrapper trying to prevent?</div><div><br></div><div>Thanks,</div><div><br></div><div><br></div>-- <br><div class="gmail_signature">Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a></div>
</div>