Ask Your Question

Custom perl installation, cpan modules installed for native perl?

asked 2011-12-09 07:44:21 -0500

bannaN gravatar image

updated 2011-12-09 08:07:25 -0500


I have a perl installation under /opt/perl, and this works fine on CentOS for instance, but once i switched to Fedora 16 i got this problem:

[root@joakim /]# /opt/perl/bin/perl -v

This is perl, v5.10.0 built for x86_64-linux

Copyright 1987-2007, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at, the Perl Home Page.

[root@joakim /]# /opt/perl/bin/cpan

cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.

Can't ioctl TIOCGETP: Invalid argument                                          
Consider installing Term::ReadKey from CPAN site nearby
Or use
    perl -MCPAN -e shell
to reach CPAN. Falling back to 'stty'.
    If you do not want to see this warning, set PERL_READLINE_NOWARN
in your environment.
cpan[1]> force install Data::Dumper
Reading '/root/.local/share/.cpan/Metadata'
  Database was generated on Thu, 08 Dec 2011 17:28:22 GMT
Running install for module 'Data::Dumper'
Running make for S/SM/SMUELLER/Data-Dumper-2.131.tar.gz
Fetching with HTTP::Tiny:

  CPAN: checksum security checks disabled because Digest::SHA not installed.
  Please consider installing the Digest::SHA module.

Scanning cache /root/.local/share/.cpan/build for sizes
............................................................................DONE Building S/SM/SMUELLER/Data-Dumper-2.131.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Data::Dumper
Could not read metadata file. Falling back to other methods to determine prerequisites
cp blib/lib/Data/
/opt/perl/bin/perl /opt/perl/lib/5.10.0/ExtUtils/xsubpp  -typemap /opt/perl/lib/5.10.0/ExtUtils/typemap  Dumper.xs > Dumper.xsc && mv Dumper.xsc Dumper.c
gcc -c   -fPIC -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2   -DVERSION=\"2.131\" -DXS_VERSION=\"2.131\" -fPIC "-I/opt/perl/lib/5.10.0/x86_64-linux/CORE"  -DUSE_PPPORT_H Dumper.c
Running Mkbootstrap for Data::Dumper ()
chmod 644
rm -f blib/arch/auto/Data/Dumper/
gcc  -shared -O2 -L/usr/local/lib Dumper.o  -o blib/arch/auto/Data/Dumper/     \

chmod 755 blib/arch/auto/Data/Dumper/
cp blib/arch/auto/Data/Dumper/
chmod 644 blib/arch/auto/Data/Dumper/
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /opt/perl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
        2/11 skipped: various reasons
        2/7 skipped: various reasons
t/perl-74170....ok ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-09 12:29:38 -0500

kubo gravatar image

CPAN module read config from ~/.cpan/CPAN/ Look at it and check mbuildpl_arg and makepl_arg variables. You can overwrite it with:

/opt/perl/bin/perl -MCPAN -e shell
cpan> o conf mbuildpl_arg "--install_base /opt/perl/"
cpan> o conf makepl_arg "PREFIX=/opt/perl/"
cpan> o conf commit

..commit is needed for write changes into config file. This user config file is common for both cpan modules. You can create new config file and load it with -j <anotherconfigfile> as argument.

And be carreful when installing libraries that have dependecies that are installed in your custom directory, you need to tell perl about it (I'm not sure about right dir, so posting both):

PERL5LIB="/opt/perl/lib/perl5:/opt/perl/share/perl5" /opt/perl/bin/perl -MCPAN -e shell
edit flag offensive delete link more

Question Tools


Asked: 2011-12-09 07:44:21 -0500

Seen: 4,057 times

Last updated: Dec 09 '11