Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Sun, 13 Apr 2003 22:29:14 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Greg Matheson cc: cygwin AT cygwin DOT com Subject: Re: Exim, .forward and DBD::Oracle In-Reply-To: <20030414065754.A13221@ms> Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 14 Apr 2003, Greg Matheson wrote: > On Sun, 13 Apr 2003, Dmitry Melekhov wrote: > > > Another problem is with perl in cygwin. > > On Linux I can set > > $ENV{PATH} and $ENV{ORACLE_HOME} inside > > perl script, but in cygwin I had to write shell script to call perl script: > > Does it work in Linux if you DON'T set $ENV{PATH} and > $ENV{ORACLE_HOME} inside your program? Are you sure they are > not set elsewhere in your environment? > > > #!/bin/sh > > PATH=/cygdrive/c/oracle/ora81/bin ORACLE_HOME='c:\oracle\ora81' > > /home/tabel/test.pl > > > or I received following error: > > > install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: dlopen: Win32 error 126 at /usr/lib/perl5/5.8.0/cygwin-multi-64int/DynaLoader.pm line 232 > > > if I try to call perl script from .forward. > > > This is thing I still don't understand. :-( > > Does it work in cygwin if you set them in a BEGIN { } block at > the top of the script. Quoting perlmod, > > A "BEGIN" subroutine is executed as soon as possible, that is, the > moment it is completely defined, even before the rest of the containing > file is parsed. ... Because a "BEGIN" block executes > immediately, it can pull in definitions of subroutines and such from > other files in time to be visible to the rest of the file. You know, Greg, I think you may have gotten it. Is it possible that Perl interprets the "use" statements before the rest of the code, and the DBI module tries to load the appropriate DLL in its initialization? Any code that sets the environment variables will not have been executed at that point. Dmitry, which versions of perl do you use on both Cygwin and Linux? > I thought the problem might be setting environmental variables in > perl perhaps only passes them to children of the process, but: > > greg AT 7106 ~ > $ perl -e '$ENV{hey}="what?"; print $ENV{hey}' > what? > greg AT 7106 ~ > $ > > shows this is not so. It might be interesting to try writing a dummy perl module with a "print" in its initialization subroutine, trying to "use" it after a "print" in the main script, and seeing which print comes out first... I haven't really written perl modules, so I can't perform the experiment myself without a learning curve, but will do so if noone else does it first and when time permits. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Knowledge is an unending adventure at the edge of uncertainty. -- Leto II -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/