+ Reply to Thread
Results 1 to 3 of 3

Thread: Perl lib path for modules

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    6

    Default Perl lib path for modules

    I'm trying to do some perl stuff and I have basic scripts working in my cgi-bin/ folder. I'm now trying to use perl modules (.pm) but I can't get them to work! Where do I put the perl modules, I tried the same directory and tried creating a lib folder (since one didn't exist). Thanks in advance.

  2. #2
    I love LAMP.
    Join Date
    Jul 2004
    Location
    Chicago, Illinois, United States
    Posts
    201

    Default

    You have to put the modules in the proper install heirarchy for their name if they contain any namespacing, such as Net::Telnet, so that you have a directory called Net/ with Telnet.pm in it.

    As for actually getting them to load in, you should push the directory containing the modules into @INC.

    For example, you could put all your modules in:

    /hsphere/local/home/user/lib, so Net::Telnet is in /hsphere/local/home/user/lib/Net/Telnet.pm

    Then, in perl do a push(@INC, "/hsphere/local/home/user/lib"); and use Net::Telnet;

    That should work.

    Also, if the modules in question aren't too unusual, we can probably install them for you server-wide. Just let us know which you need and we'll see what we can do.
    Kevin Stange
    Chief Technology Officer
    Steadfast Networks
    http://steadfast.net
    kevin@steadfast.net

  3. #3
    Junior Member
    Join Date
    Nov 2005
    Posts
    6

    Default

    Kevin, Thanks for the response! It's working well now.

+ Reply to Thread

Posting Permissions

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