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: Mon, 14 Apr 2003 10:33:58 -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: <20030414135338.A22573@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, Igor Pechtchanski wrote: > > > 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 > > greg AT 7106 ~ > $ echo 'print "hello from module\n";' > Module.pm Wow, that easy, huh? > greg AT 7106 ~ > $ perl -e 'print "hello from program\n";use Module;' > hello from module > hello from program > > I don't know if this carries over for setting $PATH, however. This kind of proves my point (that use statements are executed before the rest of the code). Also, the BEGIN block *is* executed before the modules. See below: $ echo 'print "ORACLE_HOME=$ENV{ORACLE_HOME}\n";' > Module.pm $ perl -e '$ENV{ORACLE_HOME}="aaa bbb ccc";use Module;' ORACLE_HOME= $ perl -e 'BEGIN{$ENV{ORACLE_HOME}="aaa bbb ccc";}use Module;' ORACLE_HOME=aaa bbb ccc Hope this helps the OP. 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/