1828308 Members
3538 Online
109975 Solutions
New Discussion

path to perl module

 
navin
Super Advisor

path to perl module

Hello All,
I have installed expect and IO/Tty.pm in a directory.But when i run the script which uses the expect it gets error as below.What needs to done inorder to update INC
Can't locate IO/Pty.pm in @INC (@INC contains
Thanks in advance for any idea.
Learning ...
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor

Re: path to perl module

Hi Navin:

If you installed the Perl modules using CPAN, for example, they should have been installed in a path contained in @INC. By default, your current directory is searched too:

# perl -le 'print for @INC'

A "can't locate...in @INC'

...when you do:

# perl -MExpect -e 1

...usually indicates that you *don't* have the module installed.

Regards!

...JRF...
Glenn S. Davidson
Trusted Contributor

Re: path to perl module

You say:

"I have installed expect and IO/Tty.pm in a directory"

Does this mean you didn't install the module in a "standard" fashion?

The output will tell you where it's searching for the modules. You can move the .pm files into the correct paths or re-install the module.

Another thing to look for is if you have 2 versions of perl installed. I've run into problems with this before. I know I've installed a module but it installed using the other version because the other version was found by the shell first.

If this is the case check 'which perl' for the location and do a 'perl -v' to make sure it's the version you expect. If not you can rename that version to perl.x.x and try the commands again. Or, you can just change the $PATH statement but that can cause other problems
Conformity Destroys a mans initiative and independence. It supresses his powerful inner drive to do his own thing.