<div dir="ltr"><div>I&#39;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&lt;NOTE:&gt; you MUST NOT call C&lt;&lt; $self-&gt;config &gt;&gt; or C&lt;&lt; __PACKAGE__-&gt;config &gt;&gt;</div></div><div><div>as a way of reading config within your code, as this B&lt;will not&gt; give you the</div></div><div><div>correctly merged config back. You B&lt;MUST&gt; 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 =&gt; 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(&#39;Setting config after setup has been run is not allowed.&#39;)</div></div><div><div>        if ( @_ and $c-&gt;setup_finished );</div></div><div><div><br></div></div><div><div>    $c-&gt;$orig(@_);</div></div><div><div>};</div></div></blockquote><div><br></div><div>I understand the NOTE for Model/View/Controllers where the component&#39;s __PACKAGE__-&gt;config is merged in with the application config for that component.   Calling $self-&gt;config won&#39;t be the same thing passed to the component&#39;s constructor.</div><div><br></div><div>But, what&#39;s the issue with calling $c-&gt;config( foo =&gt; 123 ) at runtime?   Or even $c-&gt;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&#39;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>