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 Bekman JAm_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

Reply via email to