5

How to tell mod_perl2 to find my Perl modules?

 3 years ago
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.
neoserver,ios ssh client

How to tell mod_perl2 to find my Perl modules?

advertisements

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?

If I define a constant in a Perl module, how do I use that constant in my main program? (Or how do I call that constant in the main program?)Constants can be exported just like other package symbols. Using the standard Exporter module, you can export

How to call a subroutine from a perl module to another perl module?

I have a perl file which makes use of two perl modules A.pm , B.pm. But in B.pm I need to call a subroutine of A.pm. Even if I give use in A.pm and try to use it I am still getting undefined error. Any help on this greatly appreciated.There's two ele

How to use a dependency on a Perl module installed in a non-standard location?

I need to install two Perl modules on a web host. Let's call them A::B and X::Y. X::Y depends on A::B (needs A::B to run). Both of them use Module::Install. I have successfully installed A::B into a non-system location using perl Makefile.PL PREFIX=/

How to tell which Oracle process a perl script uses

I have a perl script that gets data from an Oracle 11G database. Up until last week the script ran in about an hour. Starting last week the scripts runs for over 24 hours and I have to kill it. Is there a way to link the perl script to an Oracle proc

How can I pass arguments common to Perl modules?

I'm not thrilled with the argument-passing architecture I'm evolving for the (many) Perl scripts that have been developed for some scripts that call various Hadoop MapReduce jobs. There are currently 8 scripts (of the form run_something.pl) that are

How to set the font color with Perl module PDF :: API2?

I need to add colour to some text in a PDF document using PDF::API2 - how do I do that?You can set the text color by calling the fillcolor method before adding the text: use PDF::API2; my $pdf = PDF::API2->new(); # Create a PDF my $font = $pdf->core

How to organize Perl modules

I have a directory structure like this: /path/to/lib/perl5/5.22.1 I have installed some perl modules in that directory in a particular format: ls Data-UUID IPC-System-Simple JSON Log-Message Math-Gradient Term-UI For example, if you go inside JSON, t

How does a Perl program know where to find the file containing the Perl module it uses?

If my Perl program uses Perl modules, how will it determine where to find the file containing the module code? For example, if the program contains: use MyModule1; # Example 1 use This::Here::MyModule2; # Example 2 where will it look?Perl interpreter

How to find a version number of the Perl module via the command line on Unix?

Possible Duplicate: How can I find the version of an installed Perl module? I tried perl -MMODULE -e 'print Thread::Semaphore';, but it did not work! What is the right command?I found something interesting I would like to share: perl -MThread::Semaph

How to find packages (Debian / Ubuntu / & hellip;) that provide required Perl modules

I found that installing native Debian or Ubuntu Perl packages, such is often more reliable and convenient than "manually" installing Perl modules via cpanm (especially for XS-Modules). Is there an easy way to find these modules given a list of r

How can I find and remove duplicate Perl modules from the library?

I've been using Module::Build to manage my module installation and I've found that I have duplicate versions of a given module in different parts of the library: ./site_perl/5.14.2/i686-linux/site_perl/Support/Dump.pm ./site_perl/5.14.2/Support/Dump.

How to tell Hunchentoot where to find static web pages to serve?

The Hunchentoot documentation states: "The method for ACCEPTOR tries to serve a static file relative to it's ACCEPTOR-DOCUMENT-ROOT." acceptor-document-root acceptor => (or pathname null) (setf (acceptor-document-root acceptor ) new-value) ht

How do I declare a variable globally so that it is visible to all Perl modules?

Hi I have a perl script named main.pl. This perl script is calling three perl modules named sub1.pm, sub2.pm, and sub3.pm. sub.pm is returning three hashes which are being used in sub2.pm and sub3.pm. I am passing the hashes as input parameter to sub

How do I know if a Perl module is at the core or is part of the standard installation?

How can I check if a Perl module is part of the core - i.e. it is part of the standard installation? I'm looking for: a command-line command: a Perl subroutine/function to check within code Perhaps the question should be: How can I tell what modules

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK