Addition of directory to @INC variable via startup script/mod_perl
I currently have the following configuration in my httpd.conf file: PerlRequire /usr/local/apache/conf/startup.pl Alias /perl/ /usr/local/apache/cgi-bin PerlTaintCheck On PerlWarn On PerlFreshRestart On PerlTransHandler Apache::SessionManager PerlFreshRestart On Location /perl SetHandler perl-script PerlSendHeader On PerlHandler Apache::Registry Options ExecCGI /Location And here are the contents of the startup.pl script: #!/usr/bin/perl use strict; use lib qw(/usr/local/apache/require); use Apache::Registry(); use CGI(); use CGI::Session(); use CGI::Carp(); use DBI(); use Net::LDAP(); $ENV{MOD_PERL} or die "not running under mod_perl!"; 1; When I stop/start the server and run a script with the following code: foreach $item (@INC) { print ($item . "br"); } I only get the output: /usr/local/lib/perl5/5.8.0/sun4-solaris /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl . ?? I can't seem to find any rhyme or reason why the directory "/usr/local/apache/require" isn't on the @INC array? Any help is greatly appreciated.according to all documentation I can find this should actually work. I'm hoping that I'm doing something terribly stupid :). thnx, ~j
Re: Addition of directory to @INC variable via startup script/mod_perl
Jason Jolly wrote: When I stop/start the server and run a script with the following code: foreach $item (@INC) { print ($item . br); } I only get the output: /usr/local/lib/perl5/5.8.0/sun4-solaris /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl . ?? I can't seem to find any rhyme or reason why the directory /usr/local/apache/require isn't on the @INC array? When do you run that script? And why do you have PerlFreshRestart on? - Perrin
@INC variable
Hello, I have written a sample package (from a book). The package uses an Apache package - Constants.pm that its path is not included in the @INC variable. I would like to add the path to the variable by default and not in runtime as people have suggessted. Where are the default values of @INC stored ?? Thanks in advance. [EMAIL PROTECTED] = The error I recieved ... Can't locate Apache/Constants.pm in @INC (@INC contains: (...) hello.pm == package Apache::Hello; use strict; use Apache::Constants qw(:common); sub handler { my $r = shift; $r-content_type('text/html'); $r-send_http_header; my $host = $r-get_remote_host; $r-print(END); HTML HEAD TITLEHello There/TITLE /HEAD BODY H1Hello $host/H1 Testing 123 /BODY /HTML END return OK; } 1; __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/