Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Every time I add a module and try to use i get can't find module in @INC, Why?

by scottstef (Curate)
on Feb 25, 2001 at 03:39 UTC ( [id://60691]=perlquestion: print w/replies, xml ) Need Help??

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

I have added modules using:
perl Makefile.pl
make
make test
and not had any errors when I went to install.
When I try to run scripts that use the newly installed module, I get
Can't locate NET/FTP.pm in @INC
(@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at ./ftp.pl line 4.
Is there a way to change the @INC get the script to use the module which is located in
/usr/lib/perl5/site_perl/5.6.0/i386-linux/libnet-1.0703/Net? Or is there a better way to install the module?
  • Comment on Every time I add a module and try to use i get can't find module in @INC, Why?

Replies are listed 'Best First'.
Re: Every time I add a module and try to use i get can't find module in @INC, Why?
by TheoPetersen (Priest) on Feb 25, 2001 at 03:53 UTC
    Did you cut and paste the error message literally? If so, you apparently have something like use NET::FTP when you mean use Net::FTP
      Additionally, you can encounter the @INC error if it genuinely can't find the module so, you should use:
      use lib "some/dir/name";

      Mike - mps@discomsys.com

      "The two most common elements in the universe are hydrogen... and stupidity."
      Harlan Ellison

Re: Every time I add a module and try to use i get can't find module in @INC, Why?
by chromatic (Archbishop) on Feb 25, 2001 at 09:56 UTC
    That's an extremely odd path for the module. Did you do a make install step?

    On my box, Net::FTP lives in /usr/lib/perl5/site_perl/5.005/Net/FTP.pm. See if it's in the corresponding directory, which should be hardcoded into @INC.

Re: Every time I add a module and try to use i get can't find module in @INC, Why?
by tame1 (Pilgrim) on Feb 25, 2001 at 05:15 UTC
    I have no clue as to why the module install isn't working. However, as far as the other question, try "use lib /path/to/lib/file;" and then use mylib.pm. Or, you could add the path to the module to @INC in a BEGIN section, but I don't think that's very efficient. I think that's exactly what the 'use lib' does.

    What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"
Re: Every time I add a module and try to use i get can't find module in @INC, Why?
by dsb (Chaplain) on Feb 26, 2001 at 01:56 UTC
    It looks like you did every step to the install, except the actual install.

    Did you run this command?

    bash% make install
    Until you the module won't actually be "installed".

    Amel - f.k.a. - kel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://60691]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-26 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found