On Feb 10, 2008 12:37 PM, Mag Gam <[EMAIL PROTECTED]> wrote:
> 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.

That's not related to DocumentRoot.  The open() command opens files
relative to your current working directory.  If you use
ModPerl::RegsitryPreFork, that will be the same directory your script
is in.  Alternatively, you can chdir() to the directory you want.
What you're trying to do right now with DocumentRoot should be done
with chdir() instead.

- Perrin

Reply via email to