Maclir has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks, I seek advice on strange happenings with mod_perl. The contents of @INC appear to get some additional, invalid directories added to them. If I run:
#!/usr/local/bin/perl -w print "Content-type: text/html\n\n"; foreach $item(@INC){ print "$item <BR>\n"; }
from the shell, I get the following:
# ./fred Content-type: text/html /usr/local/lib/perl5/5.00503/sun4-solaris <BR> /usr/local/lib/perl5/5.00503 <BR> /usr/local/lib/perl5/site_perl/5.005/sun4-solaris <BR> /usr/local/lib/perl5/site_perl/5.005 <BR> . <BR>
When I run it under apache (1.3.12 + mod_perl 1.24), I get:
/usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 . /usr/local/apache/ /usr/local/apache/lib/perl
Any clues?

Ken

Replies are listed 'Best First'.
Re: Additions to @INC
by merlyn (Sage) on Aug 11, 2000 at 03:33 UTC
    mod_perl adds those last directories for you automatically. It should be the configuration directory, and the configuration directory with /lib/perl attached. There's no harm if you don't have those directories. I use that to hold my mod_perl-only modules for handlers.

    -- Randal L. Schwartz, Perl hacker

      Thanks for the prompt reply. In fact, the problem that let me to suspect somthing funny in that was all due to me forgetting that mod_perl has data persistance. Another reason for -w and use strict.

      Ken

RE: Additions to @INC
by Yohimbe (Pilgrim) on Aug 11, 2000 at 07:43 UTC
    The file that adds these to @INC is usually startup.perl and it is named in the apache config files something along the lines of:
    Perlrequire /home/www/perl/startup.perl
    --
    Jay "Yohimbe" Thorne, alpha geek for UserFriendly