Find the answer to your Linux question:
Results 1 to 4 of 4
Hi. I have folder where I have lots of .pm files. Now I would like to add path into @INC variable, because I don't want add this line in every ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    13

    How to add path into @INC variable?

    Hi.

    I have folder where I have lots of .pm files.

    Now I would like to add path into @INC variable, because I don't want add this line in every perl script

    use lib /path...

    How can I add path into the @INC variable ?

  2. #2
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    First of all, Google is your friend. Please use it!

    There are several ways to do this, but given your situation I believe the best way to go about it is to define the environmental variable PERL5LIB, preferably in ~/.bashrc or something.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

  3. #3
    Just Joined!
    Join Date
    Apr 2007
    Posts
    13
    Javasnob.

    I can't add any path into .bashrc etc.. because the user which uses these .pm files are nologin.

    So user doesent have own home folder, .bashrc files etc...

  4. #4
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    perl takes -I option where you can specify the additional directories where it should search for modules.

    The directories passed with -I (possibly with multiple -I instances) get added to @INC.

    HTH
    The Unforgiven
    Registered Linux User #358564

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...