Modify the contents of @INC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BobVDP
    New Member
    • Jan 2007
    • 4

    Modify the contents of @INC

    I can't seem to figure out how to modify the contents of @INC. I want to tell perl to look in a different directory when searching for modules. Any thoughts?
  • ghostdog74
    Recognized Expert Contributor
    • Apr 2006
    • 511

    #2
    if you look at the online perldoc, this is what is stated
    perldoc -q INC

    Code:
    How do I add a directory to my include path (@INC) at runtime?
    
           Here are the suggested ways of modifying your include path:
    
               the PERLLIB environment variable
               the PERL5LIB environment variable
               the perl ‐Idir command line flag
               the use lib pragma, as in
                   use lib "$ENV{HOME}/myown_perllib";
    
           The latter is particularly useful because it knows about machine dependent architectures.  The lib.pm pragmatic module was first included with the 5.002 release of Perl.

    Comment

    • miller
      Recognized Expert Top Contributor
      • Oct 2006
      • 1086

      #3
      This is what you need:

      Comment

      • BobVDP
        New Member
        • Jan 2007
        • 4

        #4
        Thanks that works. However now a new problem. Spent 5 hours searching google and online docs but ... you know the drill

        I am running IIS6 and last week all my scripts ran fine. Something changed because out of the blue all my scripts started saying "Cant locate XXX.pm in @INC" I used the lib to fix that and now I get "The specified CGI application misbehaved by not returning a complete set of HTTP headers."

        All my scripts print out "Content-type: text/html\n\n" before anything else so I thought this error was a result of installing PHP but I still get this even after I removed PHP.

        Thanks
        Bob

        Comment

        Working...