perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrin Harkins" <>
Subject Re: Question about open()
Date Mon, 11 Feb 2008 19:45:46 GMT
On Feb 10, 2008 12:37 PM, Mag Gam <> 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/, 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

View raw message