Hi Guys,
I've read the stuff in the archive, but I'm still
confused.
My situation:
I have a template object which is a global in a mod_perl
handler, currently it is setup like so:
my $root = '/vhosts/foxtons/docs/www';
###### TT2 Config
my %config = (
POST_CHOMP => 1,
INCLUDE_PATH => "$root",
COMPILE_DIR => '/data/tt',
COMPILE_EXT => '.tt_cmp',
);
######
my $tt = Template->new( \%config );
sub handler {
.......
}
This runs on www.foxtons.co.uk. What I want it to be
able to do is to change the include path from within the
handler. I would test for which version or site was
being used from %ENV{SERVER_NAME} (or something) and
then extract the site and verion from that..
my ($site,$version) = get_site_and_version();
my $new_include_path = "/vhosts/$site/docs/$version";
e.g. wap.foxtons.co.uk would give
/vhosts/foxtons/docs/wap as the include path.
I want to keep the TT object global for obvious speed
reasons and the caching needs to still work.
Any help is much appreciated. Sorry for not following
previous explinations...
Thanks
Leo