<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma, 'new york', times, serif;font-size:12pt"><div></div><div>and on the other side - ENV variables - most client-server databases already support some type of $ENV{ USER } for their out-of-the-box client tools, i.e. sqlplus, isql, etc.</div><div><br></div><div><br>&nbsp;</div>---<br>Mark Mertel<br>mark.mertel@yahoo.com<div><br></div><div style="font-family:tahoma, new york, times, serif;font-size:12pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Brian E. Lozier &lt;brian@massassi.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> SPUG Members &lt;members@seattleperl.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Thu, April 8, 2010 11:26:30 AM<br><b><span style="font-weight:
 bold;">Subject:</span></b> Re: SPUG: Best practice? DBI connection parameters *not* in Perl code<br></font><br>
Regarding YAML -- in my experience, the "YAML" module on CPAN is buggy<br>and can't properly handle complex structures.&nbsp; This bit us and we<br>moved to JSON (this wasn't for configuration).&nbsp; It should be fine for<br>simple config data (but may be a bit heavy weight for that).&nbsp; See the<br>bug list: <a href="https://rt.cpan.org/Public/Dist/Display.html?Name=YAML" target="_blank">https://rt.cpan.org/Public/Dist/Display.html?Name=YAML</a><br><br>It's been suggested to use YAML::Syck, but that's compiling its own<br>huge list of bugs as well.&nbsp; Depending on your deployment targets, you<br>may want to stick with a pure-perl solution, which, I believe,<br>YAML::Syck isn't.<br><br>I've used Config::Fast and Config::General and have been happy with both.<br><br>Brian<br><br>On Thu, Apr 8, 2010 at 10:53 AM, Skylos &lt;<a ymailto="mailto:skylos@gmail.com" href="mailto:skylos@gmail.com">skylos@gmail.com</a>&gt; wrote:<br>&gt; I'm not entirely sure
 if its best practice, but my feeling is that I would<br>&gt; prefer a config file because its a more obvious artifact that can be<br>&gt; deployed with the application.&nbsp; As for format, YAML of course.&nbsp; And here's a<br>&gt; module especial for that.<br>&gt;<br><span>&gt; <a target="_blank" href="http://search.cpan.org/~moconnor/YAML-AppConfig-0.16/lib/YAML/AppConfig.pm">http://search.cpan.org/~moconnor/YAML-AppConfig-0.16/lib/YAML/AppConfig.pm</a></span><br>&gt;<br>&gt; Skylos<br>&gt;<br>&gt;<br>&gt; On Thu, Apr 8, 2010 at 10:45 AM, Michael R. Wolf &lt;<a ymailto="mailto:MichaelRWolf@att.net" href="mailto:MichaelRWolf@att.net">MichaelRWolf@att.net</a>&gt;<br>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; As some DBI-based code is being ported to other machines, I'm having to<br>&gt;&gt; pass command-line parameters to too many administrative and test programs.<br>&gt;&gt; &nbsp;I'd like to change this *once* external to *all* programs and have it
 apply<br>&gt;&gt; to them all. &nbsp;This will have the added benefit of articulating a cleaner<br>&gt;&gt; differentiation between environments (development, test, production).<br>&gt;&gt;<br>&gt;&gt; What's more popular to do this?<br>&gt;&gt; &nbsp;- environment variables<br>&gt;&gt; &nbsp;- config file<br>&gt;&gt;<br>&gt;&gt; In code, and in *theory*, it's a trivial difference...<br>&gt;&gt;<br>&gt;&gt; &nbsp; &nbsp;$db_user = $ENV{db_user} || 'root';<br>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;versus<br>&gt;&gt; &nbsp; &nbsp;$db_user = $some_config_ref-&gt;get_attribute('db_user') || 'root';<br>&gt;&gt;<br>&gt;&gt; I'm more interested in how this works in *practice*. &nbsp;That is, when<br>&gt;&gt; fielded, which seems to be groked by more end users? &nbsp;And if the answer is<br>&gt;&gt; 'config', which of the 2 score and twenty config modules seems to be groked<br>&gt;&gt; by more end users?<br>&gt;&gt;<br>&gt;&gt; Thanks,<br>&gt;&gt;
 Michael<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;<br>&gt;<br>&gt; --<br>&gt; "If only I could get rid of hunger by rubbing my belly" - Diogenes<br>&gt;<br>&gt; _____________________________________________________________<br>&gt; Seattle Perl Users Group Mailing List<br>&gt; &nbsp; &nbsp; POST TO: <a ymailto="mailto:spug-list@pm.org" href="mailto:spug-list@pm.org">spug-list@pm.org</a><br><span>&gt; SUBSCRIPTION: <a target="_blank" href="http://mail.pm.org/mailman/listinfo/spug-list">http://mail.pm.org/mailman/listinfo/spug-list</a></span><br>&gt; &nbsp; &nbsp;MEETINGS: 3rd Tuesdays<br><span>&gt; &nbsp; &nbsp;WEB PAGE: <a target="_blank" href="http://seattleperl.org/">http://seattleperl.org/</a></span><br>&gt;<br>_____________________________________________________________<br>Seattle Perl Users Group Mailing List<br>&nbsp; &nbsp;  POST TO: <a ymailto="mailto:spug-list@pm.org" href="mailto:spug-list@pm.org">spug-list@pm.org</a><br>SUBSCRIPTION: <a
 href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank">http://mail.pm.org/mailman/listinfo/spug-list</a><br>&nbsp; &nbsp; MEETINGS: 3rd Tuesdays<br>&nbsp; &nbsp; WEB PAGE: <a href="http://seattleperl.org/" target="_blank">http://seattleperl.org/</a><br></div></div><div style="position:fixed"></div>


</div><br>

      </body></html>