I compiled the Perl DBD::Oracle module on a CentOS 5.5 recently. It took a while to figure out, that the installed Oracle 10g Express Edition included just 32-Bit libs, but the Perl version was 64-Bit and the CentOS also. To solve the problem try this Howto:
Install all rpms. If not already installed, install Perl with
yum install perl perl-DBI
We also need some libs and tools:
yum install gcc.x86_64 gcc-c++.x86_64 gcc-java.x86_64 libgcc.i386 libgcc.x86_64 compat-gcc-34.x86_64 compat-gcc-34-c++.x86_64 compat-gcc-34-g77.x86_64 compat-libgcc-296.i386 compat-libstdc++-33.i386 compat-libstdc++-33.x86_64
Now we need to set two enviroment variables:
export LD_LIBRARY_PATH /usr/lib/oracle/10.2.0.4/client64/lib/
export ORACLE_HOME /usr/lib/oracle/10.2.0.4/client64/
The next step is the compilation and installation of DBD::Oracle with CPAN-Shell(configuration needed, use defaults).
[cpan]> install DBD::Oracle
Persist the environment variables (/etc/profile.d/) if you DO NOT run the database on the same host. Otherwise you have to set the variables for the context you need them, e.g. in a Apache CGI:
SetEnv LD_LIBRARY_PATH /usr/lib/oracle/10.2.0.4/client64/lib/
Hope you get it. If you have problems leave a comment.