Connect to Oracle with Perl through Cygwin

I try to connect to Oracle through cygwin, but it fails.

The Oracle version 11.2 is installed on a Windows 2003 server.
Cygwin and Perl is installed on the same server.

cygwin>uname -a
CYGWIN_NT-5.2 N0871 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin
 
cygwin>perl -v
This is perl, v5.10.1 (*) built for i686-cygwin-thread-multi-64int

The Perl @INC variable contains the current directory ('.')

There is a DBI.pm module installed.

I cd to the directory with the DBI.pm and do:

cygwin>perl -e 'use DBI;'
Can't load './auto/DBI/DBI.dll' for module DBI: No such file or directory at
at DBI.pm line 263
BEGIN failed--compilation aborted at DBI.pm line 263.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

But there is a DBI.dll installed at ./auto/DBI.

Does this mean there is an installation problem or what?

You might need an Oracle for LINUX installed by CygWin. JAVA JDBC tools are also less fussy, like the xigole jislt command line tool and SQuirreL gui. I take it you are looking to run command line SQLPlus from a script? SQLPlus is really not that script friendly, or friendly at all, so try jisql.

Note that Oracle ships with its own Perl and DBI.
Try:

$ export PATH=$ORACLE_HOME/perl/bin:$PATH
$ # check with: which perl
$ export PERL5LIB=$ORACLE_HOME/perl/lib:$ORACLE_HOME/perl/lib/site_perl
$ # test it:
$ perl -MDBI -le1

I think my problem is solved now.

The main problem was TWO perl installations. The cygwin perl and Oracle perl. When I run my test file I used the cygwin perl interprator, and dbi.pm file from the oracle perl installation. These two didn't match.

But when I run my script with the Oracle perl interprator + the oracle dbi/dbd.pm it worked!

Thanks!