You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stephen Walton <st...@csun.edu> on 2002/12/14 01:20:05 UTC

Stupid newbie question: where is "."?

So, I'm using mod_perl as installed via RPMS on RedHat 8.0, and can't
believe that an hour of hunting hasn't netted an answer to this
apparently simple problem.  Perl scripts seem not to have "." set to
~user/public_html, as use() and require() fail on files which are in the
same directory as the CGI script.  What have I missed?  The error
message states that "." is in @INC.

To be specific, I've enabled mod_perl for ~user's files like this:

<Directory /home/user/public_html>
        Options +Includes +ExecCGI
        AddHandler perl-script .pl
        PerlHandler ModPerl::Registry::handler
        PerlOptions +ParseHeaders
</Directory>

-- 
Stephen Walton, Professor, Dept. of Physics & Astronomy, Cal State
Northridge
stephen.walton@csun.edu


Re: Stupid newbie question: where is "."?

Posted by Stas Bekman <st...@stason.org>.
Stephen Walton wrote:

Please state [mp2] or something in the subject or at least in the message so 
we don't have to guess what version you are talking about.

> So, I'm using mod_perl as installed via RPMS on RedHat 8.0, and can't
> believe that an hour of hunting hasn't netted an answer to this
> apparently simple problem.  Perl scripts seem not to have "." set to
> ~user/public_html, as use() and require() fail on files which are in the
> same directory as the CGI script.  What have I missed?  The error
> message states that "." is in @INC.
> 
> To be specific, I've enabled mod_perl for ~user's files like this:
> 
> <Directory /home/user/public_html>
>         Options +Includes +ExecCGI
>         AddHandler perl-script .pl
>         PerlHandler ModPerl::Registry::handler
>         PerlOptions +ParseHeaders
> </Directory>

Yes, ModPerl::Registry does *not* chdir to the script's dir in 2.0. Here is why:
http://perl.apache.org/docs/2.0/user/coding/coding.html#Threads_Coding_Issues_under_mod_perl

Various workarounds were discussed, but none were implemented so far. By the 
time mod_perl 2.0 is released we should sort it out. For now use mod_perl 1.0 
if that's an issue to you. Of course you are more than welcome to sort this 
problem out and submit a patch for 2.0.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com