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

I installed ActiveState Perl 5.10 which comes with DBD::Oracle. I have Oracle installed and working on the machine but when I run the script I receive:
Can't load 'C:/Perl/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:%1 is not a valid Win32 application at C:/Perl/lib/DynaLoader.pm line 202. at C:\Komodo\test\test.pl line 5 Compilation failed in require at C:\Komodo\test\test.pl line 5. BEGIN failed--compilation aborted at C:\Komodo\test\test.pl line 5.
can anyone help me? I think I set the paths correctly but not sure. When I run this script in cygwin I get a pop up box that says my OCI.dll file is missing. My Oracle installation is installed and working but I have it installed in C:\oracle and not C:\program files\. Do you think this is the problem? If so how do I fix it so Perl looks in c:\oracle?
  • Comment on problem using DBD::Oracle with Active State

Replies are listed 'Best First'.
Re: problem using DBD::Oracle with Active State
by InfiniteSilence (Curate) on Aug 27, 2008 at 23:13 UTC
    You might try sharing some part of the script, but long ago I had a similar problem and I simply specified the Oracle path in a BEGIN block, like this:
    BEGIN { if ($^O=~m/Win32/i){ $ENV{PATH} = q|c:\\WINNT\\System32;c:\\OraNT8i\\bin|; j...

    Celebrate Intellectual Diversity

      Less destructive:
      BEGIN { if ($^O=~m/Win32/i) { $ENV{PATH} .= ';c:\\OraNT8i\\bin'; } }
Re: problem using DBD::Oracle with Active State
by jand (Friar) on Aug 28, 2008 at 00:47 UTC
    You must make sure that OCI.dll is on your PATH. Make sure it exists in your C:\oracle\bin directory, and double-check that it really is on the PATH.
      I had this problem today. I'm guessing you used the ppm GUI to install DBD::Oracle. Uninstall it and install it via the command line ( ppm install DBD-oracle), you will now get a disclaimer which you need to agree to download oci.dll.
        I used Perl 5.10 from Active State. This build has DBD::Oracle already built and compiled in to it. How will agreeing to download oci.dll change anything? I have oci.dll in teh BIN directory in Oracle.