perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brett lee <brett...@yahoo.com>
Subject Re: Question about open()
Date Thu, 07 Feb 2008 15:54:01 GMT

Another option:

my $HEADER        = "$ENV{DOCUMENT_ROOT}/header.shtml";

----- Original Message ----
From: Roberto C. Sánchez <roberto@connexer.com>
To: modperl@perl.apache.org
Sent: Wednesday, February 6, 2008 8:10:08 PM
Subject: Re: Question about open()


On 
Wed, 
Feb 
06, 
2008 
at 
10:06:05PM 
-0500, 
Mag 
Gam 
wrote:
> 
Hi 
All,
> 
> 
I 
have 
been 
using 
mod_perl, 
and 
I 
have 
several 
perl-cgi 
files 
that 
use 
the
> 
open(). 
I 
use 
this 
function 
to 
open/include 
my 
header, 
footer, 
basically 
a
> 
poor 
man 
template 
system. 
Currently, 
when 
I 
open 
a 
file 
I 
have 
to 
use 
the
> 
absolute  
path 
(/var/www/appname/top.inc). 
Is 
it 
possible 
for 
me 
to 
use 
just
> 
'top.inc'? 
I 
think 
it 
trying 
to 
read 
from 
DocumentRoot, 
which 
is 
causing 
the
> 
issue. 
Has 
anyone 
ever 
faced 
this?
> 
I 
just 
set 
something 
like 
this 
in 
global.asa:

my 
$base_dir 
= 
cwd 
. 
'/';

Then 
I 
can 
make 
the 
$base_dir 
available 
globally 
and 
just 
use 
that
anywhere 
I 
need 
to 
refer 
to 
an 
on 
disk 
file.

Regards,

-Roberto

-- 
Roberto 
C. 
Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com





      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



Mime
View raw message