Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: SetEnv PERL5LIB in htaccess for Apache 2.2 versus 1.3

by graq (Curate)
on Jul 03, 2007 at 07:53 UTC ( #624612=note: print w/ replies, xml ) Need Help??


in reply to SetEnv PERL5LIB in htaccess for Apache 2.2 versus 1.3

This will depend on on other settings in your Apache configuration. Under some circumstances PERL5LIB is ignored.

My personal preference for when additional library directories are required, is to define them under a different variable and incorporate that into a wrapping class. This stops me polluting the core perl variables, and it clearly shows the purpose.

-=( Graq )=-


Comment on Re: SetEnv PERL5LIB in htaccess for Apache 2.2 versus 1.3
Re^2: SetEnv PERL5LIB in htaccess for Apache 2.2 versus 1.3
by monkfan (Curate) on Jul 03, 2007 at 09:04 UTC
    ... define them under a different variable and incorporate that into a wrapping class. This stops me polluting the core perl variables, and it clearly shows the purpose.

    Can you give example, how you do that?

    Regards,
    Edward
      Here's what I suggest:

      Somewhere in you apache config file, add something like this (the exact path can vary, of course):

      PerlRequire /var/www/perl/startup.pl

      Then create startup.pl so that it looks like this:

      use lib qw(/path/to/my/modules); use MY::MODULE; 1;

      The use lib line adds directories to the search path. If you actually put use MY::MODULE in the startup file, these modules will be preloaded when apache starts up.

        Hi,
        Thanks so much for your reply.

        I don't have the SU power, thus cannot modify config of Apache2.2. I maybe able to ask Admin to modify the Apache config. But I think I cannot ask to customize the Apache config for my home working directory (otherwise he would have to do that for everybody)

        Do you have suggestion how can I get around it with your solution? Is there a generic way the sysadmin can modify the Apache config?

        Regards,
        Edward

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://624612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-08-23 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls