Hi,

I have tried with adding the directory where perl_functions.pl lives in
my startup.pl file. Again, the error is the following:

Can't locate perl_functions.pl in @INC

I have also tried with the absolute path at require "path"; in
'search.pl' and it works ok. But I need to work with relative paths or
with a unique declaration of this path because the paths are going to
change. What can I do in this case?

Regards.

> Hi Alicia
> 
> The handling of the current working directory has changed from mod_perl
> 1 to mod_perl 2.
> 
> In mod_perl1, mod perl registry  used to chdir into the script's
> directory.
> 
> This no longer happens as mod_perl2 has to support threads, and chdir is
> not thread safe - it would affect all other threads.
> 
> Instead, the safest way to work around it is
> a) specify the absolute path to perl_functions.pl
> b) add the directory where perl_functions.pl lives into @INC by doing
> this in your startup.pl file:
> 
>    use lib qw(/path/to/perl_functions/dir/);
> 
> Clint
> 
> On Mon, 2007-05-28 at 11:55 +0200, Alicia Amadoz wrote:
> > Hi,
> > 
> > I have a problem loading a perl file under mode_perl2. I want to reuse
> > some subrutines that I have in 'perl_functions.pl' file and I am trying
> > to call this file from 'search.pl' file. 
> > 
> > I get this error:
> > 
> > Can't locate ../perl_functions.pl in @INC 
> > 
> > My configuration is the following:
> > 
> > In httpd.conf:
> > 
> > PerlPostConfigRequire
> > /usr/local/apache2/htdocs/www/p_scripts/perl-cgi/startup.pl
> > 
> > In startup.pl:
> > 
> > use lib
> > qw(/usr/local/apache2/htdocs/www/p_scripts/perl-cgi);
> > 
> > In search.pl:
> > 
> > require "../perl_functions.pl"; 
> > 
> > 'startup.pl' and 'perl_functions.pl' are in the same folder but
> > 'search.pl' is in a subfolder.
> > 
> > I would appreciate any suggestion regarding how to solve this error.
> > Thanks in advance.
> > 
> 
> 
> 


--
***********************************************
Alicia Amadoz Navarro

Evolutionary Genetics Unit
Cavanilles Institute for Biodiversity and
Evolutionary Biology
University of Valencia
Apartado Oficial 22085
E-46071 Valencia SPAIN
Phone: (+34) 96 354 3687
FAX: (+34) 96 354 3733
e-mail: [EMAIL PROTECTED]
http://www.uv.es/~biodiver/v/index.htm

***********************************************
NOTE! For shipments by EXPRESS COURIER use "Instituto
Cavanilles de Biodiversidad y Biología Evolutiva,
Polígono de la Coma s/n, 46980 Paterna (Valencia),
Spain" instead of P.O. Box no. and Post Code/City above.



Reply via email to