Re: Relative path problem

2002-12-26 Thread Stas Bekman
Andrzej Jan Taramina wrote:

Steve:



In my index.pl, I call another perl file using a reletive path, like 
../lib/work.pm. But I found this file cannot be found. Could someone tell me 
what is going on or give me some directions?


Since your script is compiled under mod_perl ahead of time, and things like 
working directory are shared amongst all processes, you cannot assume that 
the relative path will be rooted from the script location directory under mp.

You need to use fully qualified pathnames (config parameters that are passed 
into your script or read in are a good way to work around this issue).

I heard rumours that MP2 might have a better solution by the time it goes final 
next year, but that was just a rumour at this stage.  Maybe Stas can illuminate 
the matter more.

The best solution is to use a project specific namespace, rather than 
../../whatever.pm. It's all explained at:
http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perl
and the sections that follow.



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: Relative path problem

2002-12-26 Thread Andrzej Jan Taramina
Stas:

 Are you talking about registry scripts or handlers? Because the former do
 change into the script's dir.

CGI script using ModPerl::Registry and mp2.  And that doesn't seem to 
workat least not using the HTML::Template module, which under mp2 does 
not find the requested template, which is located in the same directory as the 
script.  It only finds it if I specify a fully qualified file/path. Any ideas why?

 In any case please move the discussion to the list.

Copied to list per your request.

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com




Re: Relative path problem

2002-12-26 Thread Stas Bekman
Andrzej Jan Taramina wrote:

Stas:



Are you talking about registry scripts or handlers? Because the former do
change into the script's dir.



CGI script using ModPerl::Registry and mp2.  And that doesn't seem to 
workat least not using the HTML::Template module, which under mp2 does 
not find the requested template, which is located in the same directory as the 
script.  It only finds it if I specify a fully qualified file/path. Any ideas why?

That's why I repeatedly ask to mention the mod_perl version when 
reporting problems and not leave us guessing.

Indeed, currently ModPerl::Registry and friends (mod_perl 2.0) don't 
chdir() to the script's dir, because under threads chdir() affects all 
threads.

The original poster was talking about mod_perl 1.0.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: Relative path problem

2002-12-25 Thread Andrzej Jan Taramina
Steve:

 In my index.pl, I call another perl file using a reletive path, like 
 ../lib/work.pm. But I found this file cannot be found. Could someone tell me 
 what is going on or give me some directions?

Since your script is compiled under mod_perl ahead of time, and things like 
working directory are shared amongst all processes, you cannot assume that 
the relative path will be rooted from the script location directory under mp.

You need to use fully qualified pathnames (config parameters that are passed 
into your script or read in are a good way to work around this issue).

I heard rumours that MP2 might have a better solution by the time it goes final 
next year, but that was just a rumour at this stage.  Maybe Stas can illuminate 
the matter more.

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com




Relative path problem

2002-12-24 Thread Steve Li
I installed the Win32 mod_perl 1.0 in Windows XP Professional just to see 
how it works. This distribution contains Perl 5.6.1 and Apache_1.3.27, 
together with mod_perl-1.27.

In my index.pl, I call another perl file using a reletive path, like 
../lib/work.pm. But I found this file cannot be found. Could someone tell me 
what is going on or give me some directions?






_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963