I'm not entirely sure if its best practice, but my feeling is that I would prefer a config file because its a more obvious artifact that can be deployed with the application. As for format, YAML of course. And here's a module especial for that.<br>
<br><a 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><br><br>Skylos<br><br><br><div class="gmail_quote">On Thu, Apr 8, 2010 at 10:45 AM, Michael R. Wolf <span dir="ltr"><<a href="mailto:MichaelRWolf@att.net">MichaelRWolf@att.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">As some DBI-based code is being ported to other machines, I'm having to pass command-line parameters to too many administrative and test programs. I'd like to change this *once* external to *all* programs and have it apply to them all. This will have the added benefit of articulating a cleaner 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 fielded, which seems to be groked by more end users? And if the answer is 'config', which of the 2 score and twenty config modules seems to be groked by more end users?<br>
<br>
Thanks,<br>
Michael<br>
<br>
--<br></blockquote></div><br clear="all"><br>-- <br>"If only I could get rid of hunger by rubbing my belly" - Diogenes<br>