From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
> > b) As I develop one one machine and test/deploy on another, I want
> > constructs in my config file like:
> > 
> >    if (`hostname` eq 'dev_box') {
> >         mysql_dsn = 'foobar';
> >     } elsif ((`hostname` eq 'test_box'}
> >         mysql_dsn = 'abracadabra';
> >     ...
> > 
> > Any support for that in your module of choice?
> > 
> > I know of the use-just-perl-code approach (with 'do') in the Perl
> Cookbook,
> > but I am wondering if new insights exist.
> > 
> 
> Not that I know of, that is a rather complex deal, where is hostname?
> is it in the path? what about machines that may not supply it?   If
> you want a dev/q-a/prod set of config files i have found it more
> appropriate to use the same structure in a set of 3 different config
> files, then migrate the unique config files to each of the
> environments. Granted when you change the structure you have to update
> 3 copies, but it simplifies the programming, which *should* be the
> expensive part.

To simplify this you may consider using two configs. One "global" 
that contains the settings that are the same everywhere (which will 
probably be most of them) and one "local" that will contain the 
specialties. And then read both the configs and merge them so that 
the "local" overwrites the "global". 

That was if you need to make the same change to all machines you can 
do it in the "global" config and then just copy the file.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to