<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> </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 <brian@massassi.com><br><b><span style="font-weight: bold;">To:</span></b> SPUG Members <members@seattleperl.org><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. This bit us and we<br>moved to JSON (this wasn't for configuration). It should be fine for<br>simple config data (but may be a bit heavy weight for that). 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. 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 <<a ymailto="mailto:skylos@gmail.com" href="mailto:skylos@gmail.com">skylos@gmail.com</a>> wrote:<br>> I'm not entirely sure
if its best practice, but my feeling is that I would<br>> prefer a config file because its a more obvious artifact that can be<br>> deployed with the application. As for format, YAML of course. And here's a<br>> module especial for that.<br>><br><span>> <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>><br>> Skylos<br>><br>><br>> On Thu, Apr 8, 2010 at 10:45 AM, Michael R. Wolf <<a ymailto="mailto:MichaelRWolf@att.net" href="mailto:MichaelRWolf@att.net">MichaelRWolf@att.net</a>><br>> wrote:<br>>><br>>> As some DBI-based code is being ported to other machines, I'm having to<br>>> pass command-line parameters to too many administrative and test programs.<br>>> I'd like to change this *once* external to *all* programs and have it
apply<br>>> to them all. This will have the added benefit of articulating a cleaner<br>>> differentiation between environments (development, test, production).<br>>><br>>> What's more popular to do this?<br>>> - environment variables<br>>> - config file<br>>><br>>> In code, and in *theory*, it's a trivial difference...<br>>><br>>> $db_user = $ENV{db_user} || 'root';<br>>> versus<br>>> $db_user = $some_config_ref->get_attribute('db_user') || 'root';<br>>><br>>> I'm more interested in how this works in *practice*. That is, when<br>>> fielded, which seems to be groked by more end users? And if the answer is<br>>> 'config', which of the 2 score and twenty config modules seems to be groked<br>>> by more end users?<br>>><br>>> Thanks,<br>>>
Michael<br>>><br>>> --<br>><br>><br>> --<br>> "If only I could get rid of hunger by rubbing my belly" - Diogenes<br>><br>> _____________________________________________________________<br>> Seattle Perl Users Group Mailing List<br>> POST TO: <a ymailto="mailto:spug-list@pm.org" href="mailto:spug-list@pm.org">spug-list@pm.org</a><br><span>> SUBSCRIPTION: <a target="_blank" href="http://mail.pm.org/mailman/listinfo/spug-list">http://mail.pm.org/mailman/listinfo/spug-list</a></span><br>> MEETINGS: 3rd Tuesdays<br><span>> WEB PAGE: <a target="_blank" href="http://seattleperl.org/">http://seattleperl.org/</a></span><br>><br>_____________________________________________________________<br>Seattle Perl Users Group Mailing List<br> 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> MEETINGS: 3rd Tuesdays<br> 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>