<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1443455483434_9943"><span id="yui_3_16_0_1_1443455483434_10178">You shouldn't try to change the configuration once setup if finished since at that point everything has been initialized. &nbsp;if you change stuff there its not going to do anything. &nbsp;Whats the actual use case you are trying to achieve here.</span></div><div id="yui_3_16_0_1_1443455483434_9943"><span><br></span></div><div id="yui_3_16_0_1_1443455483434_9943"><span id="yui_3_16_0_1_1443455483434_10077">FWIW Calling $c-&gt;config for application scoped stuff is ok I believe (no change, just getting the data). &nbsp;For example if I really need to do a plugin, I usually do like:</span></div><div id="yui_3_16_0_1_1443455483434_9944"><span><br></span></div><div id="yui_3_16_0_1_1443455483434_9945" class="">my $adaptor_namespace = sub {</div><div id="yui_3_16_0_1_1443455483434_9945" class="">&nbsp; my $app = shift;</div><div id="yui_3_16_0_1_1443455483434_9945" class="">&nbsp; if(my $config = $app-&gt;config-&gt;{'Plugin::InjectionHelpers'}) {</div><div id="yui_3_16_0_1_1443455483434_9945" class="">&nbsp; &nbsp; my $namespace = $config-&gt;{adaptor_namespace};</div><div id="yui_3_16_0_1_1443455483434_9945" class="">&nbsp; &nbsp; return $namespace if $namespace;</div><div id="yui_3_16_0_1_1443455483434_9945" class="">&nbsp; }</div><div id="yui_3_16_0_1_1443455483434_9945" class="">&nbsp; return 'Catalyst::Model::InjectionHelpers';</div><div id="yui_3_16_0_1_1443455483434_9945" dir="ltr" class="">};</div><div id="yui_3_16_0_1_1443455483434_9945" dir="ltr" class=""><br></div><div id="yui_3_16_0_1_1443455483434_9945" dir="ltr" class="">to create a way for the plugin to have stuff in the config. &nbsp;In this case I also created an anonymous code ref instead of a normal method so that the plugin would not pollute the application namespace so much.</div>  <br><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> On Friday, September 25, 2015 8:40 AM, Bill Moseley &lt;moseley@hank.org&gt; wrote:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv9327025887"><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&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>&nbsp; &nbsp; my $orig = shift;</div></div><div><div>&nbsp; &nbsp; my $c = shift;</div></div><div><div><br></div></div><div><div>&nbsp; &nbsp; croak('Setting config after setup has been run is not allowed.')</div></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ( @_ and $c-&gt;setup_finished );</div></div><div><div><br></div></div><div><div>&nbsp; &nbsp; $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's __PACKAGE__-&gt;config is merged in with the application config for that component. &nbsp; Calling $self-&gt;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-&gt;config( foo =&gt; 123 ) at runtime? &nbsp; Or even $c-&gt;config( \%new_config )? &nbsp;&nbsp;</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? &nbsp; What problem is that wrapper trying to prevent?</div><div><br></div><div>Thanks,</div><div><br></div><div><br></div>-- <br><div class="yiv9327025887gmail_signature">Bill Moseley<br><a rel="nofollow" ymailto="mailto:moseley@hank.org" target="_blank" href="mailto:moseley@hank.org">moseley@hank.org</a></div>
</div></div><br>_______________________________________________<br>List: <a ymailto="mailto:Catalyst@lists.scsys.co.uk" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br><br><br></div>  </div> </div>  </div></div></body></html>