Galen has asked for the wisdom of the Perl Monks concerning the following question:

I've just added Net::Telnet.pm to the perl modules on a Solaris 2.6 box. My problem is that the module libraries don't seem to be pointing to the right place. @INC includes:
/usr/local/lib/perl5/5.00503/sun4-solaris-thread 
/usr/local/lib/perl5
/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread 
/usr/local/lib/perl5/site_perl/5.005

However, the Telnet.pm module is located in:

/usr/local/lib/perl5/5.00503

When I installed, the module wasn't copied anywhere automatically. I had to copy it to this directory manually. I chose that directory because that's where all the other .pm's are. Did I do wrong? Why isn't this directory in @INC and how do I add it?

Replies are listed 'Best First'.
Re: Module libraries
by japhy (Canon) on Mar 26, 2001 at 22:46 UTC
    A module called Foo::Bar needs to be named as Bar.pm in the directory Foo/. So Net::Telnet module should be in Net/Telnet.pm.

    japhy -- Perl and Regex Hacker
      Doh. Right. It was right in front of my face and I wasn't seeing it. Thanks, all's working now.
Re: Module libraries
by chromatic (Archbishop) on Mar 26, 2001 at 22:49 UTC
    Net::Telnet lives in /usr/lib/perl5/site_perl/5.005/Net/Telnet.pm, on my Linux box. It should probably go in a similar place on yours (/usr/local/lib...).

    It's probably more useful to ask how you installed it... did you use the CPAN module or download a tarball and run 'perl Makefile.PL; make; make test; make install'? Either way, it should install automagically to the right place. If not, that's a bug and needs to be reported.

    Adding a directory to @INC can be found in How do I add a directory to my include path at runtime?, but it's probably better that the install works correctly.

Re: Module libraries
by arturo (Vicar) on Mar 26, 2001 at 22:51 UTC

    It isn't there because:

    1. you didn't install it with perl Makefile.PL; make; make install
    2. you did do the above but you don't have permissions to install into @INC (since you installed later on, perhaps when you did the installation you weren't running with proper permissions?).
    3. the module's makefile is broken (EXTREMELY unlikely).