This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Exim, .forward and DBD::Oracle


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]