I do keep my templates in other directories also.
1. If your directories are relative to the document root, and you can
take advantage of this fact by rendering a variable to remember the
template path.
2. If your template directories have nothing in common with the document
root, then you can set the variable via SetPerlVar within http.conf.
That takes the 'hard' out of your code. :)
Mag Gam wrote:
Thanks for the quick response Perrin.
I am trying to change DocumentRoot because, currently I am using
open() to load templates for my website. I have header, menu, footer
in 3 seperate files, and I generate content like that. It works fine
now, just not too dynamic when I want to move the stuff around. I have
open("/var/www/perl/header.file") hardcoded, which is a pain. I just
want open ("header.file").
If I do open("header.file") its trying to read from DocumentRoot ie.
/var/www/header.inc, which does not exist.
On Feb 10, 2008 12:32 PM, Perrin Harkins <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
On Feb 10, 2008 12:24 PM, Mag Gam <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
> my $docroot = $r->document_root('/var/www/html/perl');
Why are you trying to change the DocumentRoot?
- Perrin