perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Capone" <>
Subject Re: How to require() a file?
Date Fri, 27 Feb 2009 18:58:21 GMT
Stanisław T. Findeisen wrote:
> I am trying to require() a file using its absolute name. In command 
> line mode everything works fine, but not in Apache: [Fri Feb 27 
> 17:45:07 2009] [error] Can't locate 
> /home/stf/public_html/test/arcv/public_html/../ in @INC (@INC 
> contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> How can I require() a file when using Perl in CGI mode? Do I have to 
> modify @INC?
> I don't really feel like making it a module, and putting it into Some 
> Well Known Location is something I don't feel like even more. It's 
> just a supporting file that I want to keep together with the rest of 
> the application.


I believe the ../ in there may be what's throwing things off.  That 
would probably interpolate as

... which, unless that is indeed where is located, would 
generate the error you're seeing.

To answer your question, yes, you can absolutely do a require 
"/full/path/to/" just like that without modifying @INC.

View raw message