dropdown menu

PERL:

perl -v              shows installed perl version
perl -V              shows other perl parameters (which compiler has been used for perl compile: ccversion='', gccversion='4.2.3')
perldoc perlmodlib   lists the modules that come preinstalled with the standard perl package
perldoc perllocal    lists the optional modules that are installed in your system that don't come with perl by default
                     (or in this file if freeware perl is used: /opt/freeware/lib/perl5/<perl version>/ppc-thread-multi/perllocal.pod)
                     (or if IBM perl is used: /usr/opt/perl5/lib/<perl version>/aix-thread-multi/perllocal.pod)

perl -M<name of module> -le 'print $<name of module>::VERSION'    displays the version of a module


IBM statement about installed perl on AIX>
"If some applications need perl, the suggestion is to use the product provided by http://www.perl.com,  since the perl version delivered with AIX is for use of AIX install procedures.This version is only suppored for this AIX  purposes.."


DBI and DBD:Oracle install

(good description: http://www.computers-it.com/aix/aix_installing_perl_modules_AIX53.php)

!!!The compiler version what is used for Perl compiling and the compile what we are using now for the modules must be identical!!!


1. GCC INSTALL

these rpms have been installed:
libgcc-4.2.4-2.aix5.3.ppc.rpm
libstdc++-4.2.4-2.aix5.3.ppc.rpm
info-4.6-1.aix5.1.ppc.rpm                  <--this was missing as well

gcc-4.2.4-2.aix5.3.ppc.rpm                 <--this is the main rpm (above are dependencies)

DBI requested more gcc rpms, so we installed these as well:
gcc-c++-4.2.4-2.aix5.3.ppc.rpm
libstdc++-devel-4.2.4-2.aix5.3.ppc.rpm
gcc-c++-4.2.4-2.aix5.3.ppc.rpm



2. PERL INSTALL
As we had problem with IBM perl compiler (vac) we decided to install freeware perl (which has been compiled with gcc, that is the reason for gcc install in the previous step)

installed these rpms:
gdbm-1.8.3-1.aix5.1.ppc.rpm                <--needed dependency
perl-5.8.8-2.aix5.1.ppc.rpm                <--this is the main rpm


PATH has been set in root's .profile to use our new perl in /opt/freeware/bin:
export PATH=/opt/freeware/bin:$PATH


We had problem with this rpm perl as well, so we compiled a new one:
download from perl.org the source code (we used: perl-5.8.9)
cd <to new unzipped perl dir>
export OBJECT_MODE=64                     <--for DBD::Oracle perl module we need to compile a 64 bit version of perl
rm config.sh
./Configure -d -Dcc='gcc -maix64' -Duseshrplib -Duse64bitall -Dprefix=/usr/opt/perl5_64    <---Dprefix:will install to the given dir
make
make test
make install
/usr/opt/perl5_64/bin/perl -v              <--verify installation is completed (file /usr/opt/perl5_64/bin/perl, will show it is 64 bit)

(don't forget to set the PATH if needed for the new perl)

3. DBI MODULE
download from cpan.org (we used DBI-1.605)

cd DBI-1.605
/usr/opt/perl5_64/bin/perl Makefile.PL      <--make sure the correct perl is used (PATH should be set)
make
make test
make install

if problems:
make clean                                  <--it will clean up, so we can start from the beginning from perl Makefile.PL

To test if the DBI module is installed:
perl -e 'use DBI;'                          <--If this command returns nothing then DBI is installed.
                                               If DBI is not installed it will throw an error.

(or you cen test if you check the module version: /usr/opt/perl5_64/bin/perl -MDBI -le 'print $DBI::VERSION')


4. DBD::Oracle module
download from cpan.org (we used DBD-Oracle-1.21, but for Oracle 9 it is not good. It should be domething like: 1.19)


cd DBD-Oracle-1.21

docs says set the following variables:
export ORACLE_HOME=/b10/app/oracle/product/9.2.0
export LIBPATH=$ORACLE_HOME

I set these:
export LD_LIBRARY_PATH=/b10/app/oracle/product/9.2.0
export NLS_LANG=american_america.WE8ISO8859P9
export ORACLE_BASE=/b10/app/oracle/product/9.2.0
export ORACLE_HOME=/b10/app/oracle/product/9.2.0
export LIBPATH=$ORACLE_HOME

(if not instantclient is used, then the installed Oracle home is used)

these also needed for successful connection test with "make test':
export ORACLE_SID=BB
export ORACLE_USERID=oradba/xxxyyy          <--I asked for db user from db team



/usr/opt/perl5_64/bin/perl Makefile.PL
make
make test                                   <--we received some failed tests about unicode setting (which were not important)
make install

if problems:
make clean                                  <--it will clean up, so we can start from the beginning from perl Makefile.PL
(you can test it with: /usr/opt/perl5_64/bin/perl -MDBD::Oracle -le 'print $DBD::Oracle::VERSION')

5 comments:

  1. Check your Oracle installation! In the product directory (in version 10+) you'll find a precompiled and supported(!) version of perl with DBI and DBD included.

    ReplyDelete
    Replies
    1. Thanks a lot, I'll keep it in my mind :-)

      Delete
  2. Hi Blze,

    Could you please help on this .

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LC_ALL = (unset),
    LC__FASTMSG = "true",
    LANG = "EN_US.UTF-8"
    are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").


    Regards
    Manoj Suayl

    ReplyDelete
    Replies
    1. Hi Manoj, I did not meet these errors yet, probably you can check man page of "locale" command.

      Regards,
      Balazs

      Delete
  3. Can anyone knows how to install excel plugin for perl in aix 6.1 version

    ReplyDelete