Re: [htmltmpl] placing .tmpl files in a subdirectory?
Brought to you by:
samtregar
|
From: Roger B. W. <ro...@fi...> - 2002-07-02 21:21:34
|
On Tue, Jul 02, 2002 at 02:10:58PM -0700, Douglas Kirkland wrote:
>Ok I am curious, Can I do the following. This way I can have the template
>name that is assocated with the script and at the same level as the script
>directory. All the while not having to modify the following line. I would
>like it to be a cut and paste into each script.
Yes, though what I do is:
my $fn=$0;
$fn =~ /\/([^\/]*?)\.cgi$/;
$fn="$1.tmpl";
&set_env;
my $tmpl=HTML::Template->new(filename => $fn,
die_on_bad_params => 0);
where &set_env sets the HTML_TEMPLATE_ROOT. The directory structure is:
cgi-bin/
a.cgi
b.cgi
etc.
templates/
a.tmpl
b.tmpl
etc.
Roger
|