Can'T Locate Perl Module After Cpan Installation
1
0
Entering edit mode
11.0 years ago

Hi all,

(I apologize if this question/problem is discussed somewhere else, nevertheless I wasn't able to google it so here it goes:)

I tried to install a perl module with cpan (with sudo, tried force as well ).

Running the script still returns a "Can't locate ABI.pm in @INC".

Running find / -name ABI.pm returns:

/home/karlo/.cpan/build/ABI-1.0-4ZD0zA/ABI.pm
/home/karlo/.cpan/build/ABI-1.0-CESho8/ABI.pm
/home/karlo/.cpan/build/ABI-1.0-sUTldK/ABI.pm
/home/karlo/.cpan/build/ABI-1.0-3Zjnsa/ABI.pm
/home/karlo/.cpan/build/ABI-1.0-LyVwCk/ABI.pm
/home/karlo/.cpan/build/ABI-1.0-Sy2Qmc/ABI.pm

(with all my installation tries) running the script with -I /home/.../ABI.pm helps. But I feel I needn't be doing this include with what seems to be a temporary installation folder (none of the other modules installed by cpan require this kind of special attention, why should this one be any different). I assume the installation is skipping a step where the module should be copied into one of the folders of the @INC path...

I could just add the folder to the @INC path... but then again, it would be the kind of special attention I don't think a properly installed packaged should diserve...

Any advice on a better/proper way of handling this module?

Thank you in advance...

perl • 12k views
ADD COMMENT
1
Entering edit mode

There is something that went wrong during installation, some error message you missed or did wrong. You have to post the complete output of the install command. You are correct with your concern about the proper installation of the module.

BTW: this question is rather a basic question about use of cpan and would likely apply to any module installation problem.

ADD REPLY
0
Entering edit mode

I have exactly the same problem. We have multiple versions of perl installed in the system, and I am not able to find a lib installed through cpan.

Have you figured out how to include the lib?

Thanks.

ADD REPLY
4
Entering edit mode
11.0 years ago
SES 8.6k

The problem appears to be with the Build.PL script included with this package, and the fact that you likely have your CPAN shell set to use Module::Build. You can check if this is true by starting the CPAN shell and running the command o conf prefer_installer (if it prints "prefer_installer [MB]" then it's using Module::Build). For some reason, the ./Build script is not building the package in the /blib directory as it should, so my guess is that there is nothing for ./Build install to do (and strangely, running ./Build produces the message "Building ABI" and so does ./Build install). One solution would be to download the tarball from CPAN, and use make to build the package. Something like the following should work:

$ tar xzf ABI-1.0.tar.gz
$ cd ABI-1.0
$ perl Makefile.PL
$ make
$ make test
$ make install

Those commands generated the correct build and installation on my computer. Running make install should indicate where the documentation and module (only one, in this case) were installed. In case it doesn't go smoothly for you or the process is still unclear, here are couple of helpful commands for debugging the installation of Perl packages.

$ perl -MABI -e 1
$ perl -e 'print join "\n", @INC'
  1. The first command will check if the module ABI is installed. If it prints nothing, it's installed. If it prints "Can't locate ABI.pm in @INC..." then it's not installed.
  2. The second command will show you will where modules are loaded from (the last PATH will always be "." indicating that the current directory is searched if all else fails).
ADD COMMENT

Login before adding your answer.

Traffic: 2289 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6