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

I am new to Perl and the Programmers want me to install Text::CSV and File::Copy using CPAN. we have 2 versions of perl on the Linux server (5.10.1 and 5.14.1). we have a symbolic link to the perl 5.14.1 in /usr/bin. I have tried using the following CPAN commands

CPAN>o conf Makefile.PL INSTALL_BASE=/u01/app/oracle/product/12.1.0/client_2/perl/bin/perl

We are getting errors install File::Copy as

ERROR: Can't create '/u01/app/oracle/product/12.1.0/client_2/perl/bin/ +perl/lib/perl5' mkdir /u01/app/oracle/product/12.1.0/client_2/perl/bin/perl: File exis +ts at /usr/share/perl5/ExtUtils/Install.pm line 483 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! at -e line 1 make: *** [pure_site_install] Error 17 INGY/YAML-1.23.tar.gz /usr/bin/make install -- NOT OK Warning (usually harmless): 'YAML' not installed, will not store persi +stent state Failed during this command: TYEMQ/Algorithm-Diff-1.1903.tar.gz : install NO NEILB/Text-Diff-1.44.tar.gz : install NO INGY/Spiffy-0.46.tar.gz : install NO INGY/Test-Base-0.88.tar.gz : install NO INGY/Test-YAML-1.06.tar.gz : install NO INGY/YAML-1.23.tar.gz : install NO

Here is the perl version info.

-rwxr-xr-x. 2 root root 7184 Nov 10 2015 /usr/bin/perl -rwxr-xr-x. 2 root root 7184 Nov 10 2015 /usr/bin/perl5.10.1 lrwxrwxrwx. 1 root root 53 Jan 27 12:22 /usr/bin/perl5141 -> /u01/a +pp/oracle/product/12.1.0/client_2/perl/bin/perl [oracle@peab ~]$ perl5141 -V Summary of my perl5 (revision 5 version 14 subversion 1) configuration +: <p> Platform: osname=linux, osvers=2.6.18-238.0.0.0.1.el5xen, archname=i686-linu +x-thread-multi uname='linux adc2280111 2.6.18-238.0.0.0.1.el5xen #1 smp tue jan 4 + 07:38:47 est 2011 i686 i686 i386 gnulinux ' config_args='-Dprefix=/ade/smayer_perl_5141_32/perl -Dcc=icc -Dopt +imize=-O3 -Dusethreads -Duseithreads -Duserelocatableinc -Uusemymallo +c -des -Acppflags=-DPERL_USE_SAFE_PUTENV -Accflags=-mp1 -fPIC -fp_por +t -Aldflags=-i-static -Alddlflags=-i-static -shared -O3 -L/usr/local/ +lib' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='icc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -we147 -mp -no-gcc +-mp1 -fPIC -fp_port -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_ +OFFSET_BITS=64', optimize='-O3', cppflags='-DPERL_USE_SAFE_PUTENV -D_REENTRANT -D_GNU_SOURCE -we147 + -mp -no-gcc -mp1 -fPIC -fp_port -I/usr/local/include' ccversion='10.1 20100527', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='icc', ldflags =' -i-static -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags=' ', lddlflags=' -i-static -shared -O3 -L/usr/local/lib +' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREADS USE_LARGE_FILE +S USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under Linux Compiled at Dec 22 2011 10:18:48 @INC: /u01/app/oracle/product/12.1.0/client_2/perl/lib/site_perl/5.14.1/ +i686-linux-thread-multi /u01/app/oracle/product/12.1.0/client_2/perl/lib/site_perl/5.14.1 /u01/app/oracle/product/12.1.0/client_2/perl/lib/5.14.1/i686-linux +-thread-multi /u01/app/oracle/product/12.1.0/client_2/perl/lib/5.14.1

Thanks for any help Larry

Replies are listed 'Best First'.
Re: direct CPAN to use a different version of Perl
by marto (Cardinal) on Apr 12, 2017 at 13:32 UTC

    Welcome. That's the perl which ships with Oracle. My advice would be to leave that alone, either use the system perl to install modules or install your own perl elsewhere on the system. The reason being ISTR Oracle updates being rather stupid, you may have modules blown away during patches/upgrades. Oracles perl has it's own cpan which you could run to install modules to this perl, if you insist on going that way. Update: Also your post was not formatted correctly, making it more difficult to read. Please read PerlMonks for the Absolute Beginner & How do I post a question effectively?.

Re: direct CPAN to use a different version of Perl
by Anonymous Monk on Apr 12, 2017 at 17:01 UTC
    use perlbrew!
    \wget -O - https://install.perlbrew.pl | bash source ~/perl5/perlbrew/etc/bashrc perlbrew install perl-5.24.0 perlbrew switch perl-5.24.0 perlbrew install-cpanm cpanm install Text::CSV
    And then later in your perl script:
    #!/usr/bin/env perl