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

So I am trying to upgrade a couple of modules in my perl library, and for this example I will use the Compress::Raw::Zlib one. The issue I am having is that even thought he whole prosssess goes smoothly the distro still thinks I am using the old library ?

Step 1: Perly
bash-4.1$ perl Makefile.PL Parsing config.in... Building Zlib enabled Auto Detect Gzip OS Code.. Setting Gzip OS Code to 3 [Unix/Default] Looks Good. Up/Downgrade not needed. Checking if your kit is complete... Looks good Writing Makefile for Compress::Raw::Zlib
Step 2: Make
bash-4.1$ make cp lib/Compress/Raw/Zlib.pm blib/lib/Compress/Raw/Zlib.pm AutoSplitting blib/lib/Compress/Raw/Zlib.pm (blib/lib/auto/Compress/Ra +w/Zlib) /opt/openpkg/current/bin/perl /opt/openpkg/current/lib/perl/site_perl/ +5.12.1/ExtUtils/xsubpp -typemap /opt/openpkg/current/lib/perl/5.12.1 +/ExtUtils/typemap -typemap typemap Zlib.xs > Zlib.xsc && mv Zlib.xsc + Zlib.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H Zlib.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H adler32.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H crc32.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H infback.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H inflate.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H uncompr.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H compress.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H deflate.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H inffast.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H inftrees.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H trees.c /opt/openpkg/current/bin/gcc -c -I./zlib-src -fno-strict-aliasing -pi +pe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -DPERL_USE_SAFE_PUTENV -O2 -pipe -DVERSION=\"2.037\" -DXS_V +ERSION=\"2.037\" -fPIC "-I/opt/openpkg/current/lib/perl/5.12.1/sun4-s +olaris/CORE" -DNO_VIZ -DGZIP_OS_CODE=3 -DUSE_PPPORT_H zutil.c Running Mkbootstrap for Compress::Raw::Zlib () chmod 644 Zlib.bs rm -f blib/arch/auto/Compress/Raw/Zlib/Zlib.so /opt/openpkg/current/bin/gcc -Wl,-E -G -L/opt/openpkg/current/lib Zli +b.o adler32.o crc32.o infback.o inflate.o uncompr.o compress.o deflat +e.o inffast.o inftrees.o trees.o zutil.o -o blib/arch/auto/Compress +/Raw/Zlib/Zlib.so \ \ chmod 755 blib/arch/auto/Compress/Raw/Zlib/Zlib.so cp Zlib.bs blib/arch/auto/Compress/Raw/Zlib/Zlib.bs chmod 644 blib/arch/auto/Compress/Raw/Zlib/Zlib.bs Manifying blib/man3/Compress::Raw::Zlib.3
Step 3: Test
make test PERL_DL_NONLAZY=1 /opt/openpkg/current/bin/perl "-MExtUtils::Command:: +MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/000prereq.t ...... ok t/01version.t ...... ok t/02zlib.t ......... ok t/07bufsize.t ...... ok t/09limitoutput.t .. ok t/18lvalue.t ....... ok t/99pod.t .......... ok All tests successful. Files=7, Tests=706, 12 wallclock secs ( 0.53 usr 0.09 sys + 11.33 cus +r 0.37 csys = 12.32 CPU) Result: PASS
Step 3: Install
bash-4.1$ make install Files found in blib/arch: installing files in blib/lib into architectu +re dependent library tree Appending installation info to /opt/openpkg/current/lib/perl/5.12.1/su +n4-solaris/perllocal.pod
Step 4: Test the version
bash-4.1$ perl use Compress::Raw::Zlib 2.037; Compress::Raw::Zlib version 2.037 required--this is only version 2.023 + at - line 1. BEGIN failed--compilation aborted at - line 1.
Environment :
bash-4.1$ env HZ= TERM=vt100 SHELL=/bin/bash TMPDIR=/opt/openpkg/tmp OLDPWD=/tmp/perl LD_LIBRARY_PATH=/opt/openpkg/current/oracle/product/10.2.0/Db_1/lib32: +/opt/openpkg/current/lib:/usr/local/lib ORACLE_BASE=/opt/openpkg/current/oracle/ PATH=/opt/openpkg/current/oracle/product/10.2.0/Db_1/bin:/opt/openpkg/ +current/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/bin: MAIL=/usr/mail/openpkg PWD=/tmp/perl/Compress-Raw-Zlib-2.037 TZ=Asia/Riyadh HOME=/export/home/openpkg SHLVL=2 LOGNAME=openpkg ORACLE_HOME=/opt/openpkg/current/oracle/product/10.2.0/Db_1 _=/usr/bin/env bash-4.1$ bash-4.1$ bash-4.1$ which perl /opt/openpkg/current/bin/perl

Replies are listed 'Best First'.
Re: Compress::Raw::Zlib will not upgrade
by duyet (Friar) on Aug 13, 2011 at 07:45 UTC
    It looks like you still using an old library version. You can dump @INC to find out about the paths and dump %INC (i recently learned from another post) to check from where your Zlib is being included.
      bash-4.1$ perl use Data::Dumper; print Dumper @INC; $VAR1 = '/opt/openpkg/current/lib/perl/site_perl/5.12.1/sun4-solaris'; $VAR2 = '/opt/openpkg/current/lib/perl/site_perl/5.12.1'; $VAR3 = '/opt/openpkg/current/lib/perl/vendor_perl/5.12.1/sun4-solaris'; $VAR4 = '/opt/openpkg/current/lib/perl/vendor_perl/5.12.1'; $VAR5 = '/opt/openpkg/current/lib/perl/5.12.1/sun4-solaris'; $VAR6 = '/opt/openpkg/current/lib/perl/5.12.1'; $VAR7 = '.';
        Using lsmodsh i get cmd? m Compress::Raw::Zlib Available commands are: f prog|doc - List installed files of a given type d prog|doc - List the directories used by a module v - Validate the .packlist - check for missing files t <tarfile> - Create a tar archive of the module h - Display module help q - Quit the module Compress::Raw::Zlib cmd? f all all files in Compress::Raw::Zlib are: /opt/openpkg/current/lib/perl/5.12.1/sun4-solaris/Compress/Raw/Zlib.pm /opt/openpkg/current/lib/perl/5.12.1/sun4-solaris/auto/Compress/Raw/Zlib/Zlib.bs /opt/openpkg/current/lib/perl/5.12.1/sun4-solaris/auto/Compress/Raw/Zlib/autosplit.ix /opt/openpkg/current/man/man3/Compress::Raw::Zlib.3 /opt/openpkg/current/lib/perl/5.12.1/sun4-solaris/auto/Compress/Raw/Zlib/Zlib.so
Re: Compress::Raw::Zlib will not upgrade
by Anonymous Monk on Aug 13, 2011 at 08:42 UTC

    Paste perl -V

    If you install modules into perl -V:installsitearch -V:installsitelib but perl  -V:installarchlib  -V:installprivlib appear before sitearch/sitelib in @INC, no amount of upgrading will load the newer module first :)

    Fix your @INC, or fix your install target but don't ask me how

      bash-4.1$ perl -V
      Summary of my perl (revision 5 version 12 subversion 1) configuration:
      Platform:
      osname=solaris, osvers=2.10, archname=sun4-solaris
      uname='sunos mobilydnoss-dev02 5.10 generic_142900-03 sun4v sparc sunw,sparc-enterprise-t5120 ' config_args='-d -e -s -Dcf_by=OpenPKG-CURRENT -Dcf_email=http://www.openpkg.org/ -Dprefix=/opt/openpkg/current -Dvendorprefix=/opt/openpkg/current -Dinstallprefix=/opt/openpkg/current -Dinstallstyle=lib/perl5 -Dman1dir=/opt/openpkg/current/man/man1 -Dman3dir=/opt/openpkg/current/man/man3 -Dcc=/opt/openpkg/current/bin/gcc -Doptimize=-O2 -pipe -Dlocincpth=/opt/openpkg/current/include -Dloclibpth=/opt/openpkg/current/lib -Dldflags=-L/opt/openpkg/current/lib -Dlibpth=/opt/openpkg/current/lib /lib /usr/lib /usr/ccs/lib -Dglibpth=/opt/openpkg/current/lib /lib /usr/lib /usr/ccs/lib -Dscriptdir=/opt/openpkg/current/bin -Uinstallusrbinperl -Ui_malloc -Ui_iconv -Ui_db -Uusedevel' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define,
      usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler:
      cc='/opt/openpkg/current/bin/gcc', ccflags ='-fno-strict-aliasing -pipe -I/opt/openpkg/current/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV', optimize='-O2 -pipe', cppflags='-fno-strict-aliasing -pipe -I/opt/openpkg/current/include' ccversion='', gccversion='4.5.1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='/opt/openpkg/current/bin/gcc', ldflags ='-L/opt/openpkg/current/lib ' libpth=/opt/openpkg/current/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-E' cccdlflags='-fPIC', lddlflags=' -Wl,-E -G -L/opt/openpkg/current/lib'

      Characteristics of this binary (from libperl):
      Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_USE_SAFE_PUTENV USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under solaris
      Compiled at Aug 14 2010 12:56:44
      @INC:
      /opt/openpkg/current/lib/perl/site_perl/5.12.1/sun4-solaris
      /opt/openpkg/current/lib/perl/site_perl/5.12.1
      /opt/openpkg/current/lib/perl/vendor_perl/5.12.1/sun4-solaris
      /opt/openpkg/current/lib/perl/vendor_perl/5.12.1
      /opt/openpkg/current/lib/perl/5.12.1/sun4-solaris
      /opt/openpkg/current/lib/perl/5.12.1
      .

        Resolved, if not elegantly. The module seems to be installed in 2 places as sugggested, but the original was in a directory that had presidence in the lookup path hierarchy. The way i got round this was by changing an environementat variable

         export PERL5LIB=/opt/openpkg/current/lib/perl/5.12.1/sun4-solaris/

        This seems to now work

        bash-4.1$ perl use Compress::Raw::Zlib 2.037; exit

        Is this the best way to do this, or sound I just manualy delete the modules from the other location ?

Re: Compress::Raw::Zlib will not upgrade
by pvaldes (Chaplain) on Aug 13, 2011 at 09:56 UTC
    Have you tried cpan install Compress::Raw::Zlib ?
      CPAN install has the same issue, it upgrades but then forgets that the newer libraries exist.
        You can 'unshift' the new path on top/at the beginning of your @INC