hi, sorry need to ask when is the next meeting ? or any other meetings and or events in the sfbay area, thanks<br><br><div class="gmail_quote">On Tue, Mar 18, 2008 at 1:12 PM, Steve Fink &lt;<a href="mailto:sphink@gmail.com">sphink@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Mon, Mar 17, 2008 at 11:28 PM, Anirvan Chatterjee<br>
&lt;<a href="mailto:x.sfpug@chatterjee.net">x.sfpug@chatterjee.net</a>&gt; wrote:<br>
&gt; &nbsp;1) Have a class-wide preference indicating the default style:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Class-&gt;default_string_style(&#39;normalized&#39;);<br>
&gt;<br>
&gt; &nbsp;2) Let users set their preference via a magic variable:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; local $Class::default_string_style = &#39;normalized&#39;;<br>
&gt;<br>
&gt; &nbsp;The first option seems cleaner, and easier to subclass (were that an<br>
&gt; &nbsp;issue); it also allows for better error handling when the user calls<br>
&gt; &nbsp;the class method. Unfortunately, setting a class-wide flag also blows<br>
&gt; &nbsp;away any prior settings. Two pieces of code using the module will<br>
&gt; &nbsp;necessarily overwrite each other&#39;s preferences.<br>
&gt;<br>
&gt; &nbsp;Using a variable seems uglier, but allows users to safely intermix<br>
&gt; &nbsp;different preference values in different contexts.<br>
<br>
</div>Just to add to the set of possibilities, you could make the settings<br>
only apply to the package that requested them. So the syntax could<br>
either be your original #1:<br>
<div class="Ih2E3d"><br>
 &nbsp;Class-&gt;default_string_style(&#39;normalized&#39;)<br>
<br>
</div>or you could make it explicit<br>
<br>
 &nbsp;Class-&gt;default_string_style(__PACKAGE__, &#39;normalized&#39;)<br>
<br>
default_string_style() would then use caller() or the passed-in<br>
package name to record who wants what, and the stringification would<br>
use caller() to decide whose setting to use.<br>
<br>
I&#39;m not recommending it, just pointing it out.<br>
<br>
If you really wanted to be able to use local() but still have<br>
package-scoping, you could always do<br>
<br>
 &nbsp;our $STRINGIFICATION_SETTING;<br>
 &nbsp;local $STRINGIFICATION_SETTING = ...;<br>
<br>
and have stringification use caller() to look up that variable in its<br>
caller&#39;s package.<br>
<br>
Whee.<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
SanFrancisco-pm mailing list<br>
<a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm" target="_blank">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a><br>
</div></div></blockquote></div><br>