Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: How to change @INC permanently?

by xdg (Monsignor)
on Aug 24, 2005 at 05:25 UTC ( #486102=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to change @INC permanently?
in thread How to change @INC permanently?

A somewhat simpler approach for a "semi-permanent" solution may be to set the PERL5LIB environment variable to the directories you want to always make available. See perlrun.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^4: How to change @INC permanently?
by merlyn (Sage) on Aug 24, 2005 at 06:44 UTC
    set the PERL5LIB environment variable
    In my experience, ensuring that an environment variable is set for every possible process that might execute my script is pretty unlikely, not to mention that a setuid script ignores that variable.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      I like to give people options. Not everyone feels comfortable recompiling perl. Given that the OP was looking in Super Search to find out about use lib, it seemed to me that a recompile or editing the binary might be the proverbial atomic bomb to swat a fly.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re^4: How to change @INC permanently?
by Anonymous Monk on Aug 26, 2005 at 19:44 UTC
    He could begin his script with
    #!/usr/bin/perl -mlib=/path

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2020-06-03 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (22 votes). Check out past polls.

    Notices?