Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Monks,

I have spent many hours wrestling this problem.

I have source installs of mod_perl 1.29, apache 1.3.33 and perl 5.8.7.
I have a directory that I wish to add to @INC.

Under mod_perl this works fine, I just PerlSetEnv /dir in httpd.conf and that's it everything works.

The problem occurs whenever I run my scripts under mod_cgi they cannot find any code in my custom lib.

Everything works fine at command line and I have exported PERL5LIB as an environment variable in /etc/profile.

When I use CGI::Carp qw/fatalsToBrowser/;

I get 'Can't locate in @INC', @INC is then shown with my /dir proudly listed at the front laughing at me.

I have tried the follwing:
1. 'SetEnv /dir' in httpd.conf - @INC shows my dir in the error message but still i get the can't locate message.
2. use lib '/dir'; This has no affect on @INC, the script still dies when it hits a use statement.
3. unshift @INC, '/dir'; This also has no affect the script dies on use statement if I remove the use statement and print @INC step 2 and 3 show my dir as present.

This is driving me nuts,how can 'use lib' be ignored and unshifting onto @INC be ignored. I have tried using Module::Locate and printed %INC both to no avail. The only way it works is if I move my dir into the built in path /usr/local/lib/perl5/5.8.7/i686-linux /usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/i686-linux /usr/local/lib/perl5/site_perl/5.8.7/ /usr/local/lib/perl5/site_perl/

I am using this same setup on other servers with the only difference being the perl version. the dir permissions are 755. This must be something todo with apache or taint but I am now at a loss what to try. grateful for any ideas thanks

update: fixed fatalsToBrowser typo

In reply to can't locate under mod_cgi by hakkr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-23 06:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found