I've got a number of different configurations for building a given site, so
I use different .ttreerc files. For example:
.ttreerc.dev
.ttreerc.test
.ttreerc.live
[I'm selecting different sections in my "config" file as described by Paul
Sharpe "making directory layout portable" on Mon, 05 Nov 2001 22:55:43 +0000]
I find that I'm duplicating a lot (ok, not a lot, but some) of my process
options in both my .ttreerc files and my "config" file (and in my CGI
templates).
For example, in a .ttreerc file I might have:
lib = /home/moseley/siteA/ttlib
perl5lib = /home/moseley/siteA/ttlib
plugin_base = Plugin
src = /home/moseley/siteA/ttlib/websrc/
dest = /home/moseley/siteA_public_html
pre_process = config
But I also need some of those same settings in my source files such as in
CGI scripts:
use lib '[% conf.plugin_lib %]';
my $config = {
INCLUDE_PATH => '[% conf.ttlib %]',
PRE_PROCESS => '[% conf.pre_process %]',
PLUGIN_BASE => '[% conf.plugin_base %]',
};
which means I repeat those settings in my "config" file.
What would be nice is if ttree could just be pointed to my "config" file
and read the config info from the %config hash.
It would also make my CGI "templates" a little cleaner and easier to
maintain if all I needed was:
my $config = {
PRE_PROCESS => '[% conf.pre_process %]',
};
and the rest of the Processing Options were read from that config file. In
other words, both ttree and my call to $tt->process() got their config
options from the same place.
I suppose I could just do this in my CGI scripts:
my $config = {
[% process_options %]
};
But then I think I'd still need to define my settings in two spots in my
config file.
Minor issue, but I just got caught running a .ttreerc file and a config
file where paths didn't match up and wondered why the CGI scripts were not
working as expected (ended up using the wrong plugin).
So, in other words, run something like:
ttree -f $HOME/siteA/ttlib/config --define conf=foo --getconfig=conf
so it would use the "foo" config section, and read its config options from
%conf.
Anyone follow what I'm asking?
Thanks,
--
Bill Moseley
mailto:[EMAIL PROTECTED]