

How to tell mod_perl2 to find my Perl modules?
source link: https://www.codesd.com/item/how-to-tell-mod-perl2-to-find-my-perl-modules.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to tell mod_perl2 to find my Perl modules?
I just installed my system with Oracle 64-bit Linux5.4 running Apache Server version: Apache/2.2.3 and mod_perl 2.
Now, I have my Perl libraries set in a specific path: /my/perl/libs and I have adjusted my httpd.conf to compensate for this (I added the below):
SetEnv MY_LIBS /my/perl/libs
and in my CGI programs I'm setting my environment to compensate:
use lib($ENV{'MY_LIBS'});
Sometimes my Perl modules will recognize the path of /my/perl/libs and call all the functions appropriately, and sometimes they won't, thus thowing a 500 error.
When I restart apache (/etc/init.d/httpd restart
), things work fine but then the 500 error comes up.
Are there any ideas? What should I be looking at?
You can't just 'use lib' in a mod_perl2 script. You need to either create a 'startup.pl' script with the needed 'use lib' or add a PerlSwitches option. See http://perl.apache.org/docs/2.0/user/config/config.html#Adjusting_C__INC
Related Articles
How can I use constants from a Perl module?
How to call a subroutine from a perl module to another perl module?
How to use a dependency on a Perl module installed in a non-standard location?
How to tell which Oracle process a perl script uses
How can I pass arguments common to Perl modules?
How to set the font color with Perl module PDF :: API2?
How to organize Perl modules
How does a Perl program know where to find the file containing the Perl module it uses?
How to find a version number of the Perl module via the command line on Unix?
How to find packages (Debian / Ubuntu / & hellip;) that provide required Perl modules
How can I find and remove duplicate Perl modules from the library?
How to tell Hunchentoot where to find static web pages to serve?
How do I declare a variable globally so that it is visible to all Perl modules?
How do I know if a Perl module is at the core or is part of the standard installation?
Recommend
-
59
README.md vim-perl
-
59
-
69
Post with 0 votes and 10409 views. Declaring variables in Perl
-
42
For most of last week I was out of London running three days of Perl training for… well, I probably shouldn’t name them, so let’s just call them a well-known British educational establishment. The photo above is a big clu...
-
26
Ternary Trouble in Perl I ran into a problem in Perl the other day that has perplexed me since, simply because I ha...
-
36
导读 Perl 起初是由 Larry Wall 为了让在 UNIX 上进行报表处理的工作变得更加方便而设计和开发的实用摘录和报告语言(Practical Extraction and Report Language),它借鉴了 C、awk、shell 脚本以及很多其它编程语言的特性。Larry Wall 本人也是一个语言...
-
14
-
6
Go 语言使用 Go Modules(go.mod) 来管理依赖 2021-08-17 — Yanbin 前几日系统性差不多读完了一本讲解 Go 语言的书籍,记录下几篇笔记,现在终于能够开始看看专题性的知识了。首先就是关于 Go 如何管理依赖的问题,Java 经历了最早逐个下载...
-
2
tech Meta Wouldn’t Tell Us How It Enforces Its Rules In...
-
5
We Bought the Cheapest DDR5 RAM Modules We Could Find, Are They Any Good? Time to Leave DDR4 By Steven Walton
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK