PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: marsden at sybase dot com (Katherine Marsden)
Subject: Re: perl and LD_LIBRARY_PATH
Date: Dec 12 1997 11:32PM

Thanks for your help.

I was wondering if you could send me your "exec trick".

Are the archives of this mailing list on-line somewhere?
If not could I get added to the list?


Kathey

> From mpeppler@mbay.net Fri Dec 12 15:22 PST 1997
> Date: Fri, 12 Dec 1997 15:20:10 -0800
> From: Michael Peppler 
> Mime-Version: 1.0
> To: SYBPERL-L@trln.lib.unc.edu
> Cc: Katherine Marsden , psrc@corp.airmedia.com
> Subject: Re: perl and LD_LIBRARY_PATH
> Content-Transfer-Encoding: 7bit
> 
> Paul S R Chisholm wrote:
> > 
> > Katherine Marsden wrote:
> > > $ENV{LD_LIBRARY_PATH} .= "/usr/local/system10/lib:$ENV{LD_LIBRARY_PATH};
> > >
> > > use Sybase::DBlib;
> > 
> > Not tested:
> > 
> > BEGIN {
> >     $ENV{LD_LIBRARY_PATH} = "/usr/local/system10/lib:$ENV{LD_LIBRARY_PATH}";
> > }
> > 
> > use Sybase::DBlib;
> > 
> > ... because "use" happens *before* the first executable statement, as
> > if it was a "require" inside a "BEGIN" block. Setting a variable inside
> > a "BEGIN" block that's *before* the "use" will work.
> 
> You are correct in saying that any environment changes that need to 
> be made for the Sybase libs should be done in a BEGIN block before
> the "use Sybase::DBlib".
> 
> However, LD_LIBRARY_PATH is not one of them, because you need to 
> affect the way ld.so works, and that can only be done for child
> processes.
> 
> So to reiterate: LD_LIBRARY_PATH needs to be set *before* the
> program that needs it is started. For perl scripts this usually
> involves writing a small shell wrapper, or making sure that that
> info is in the environment through some other means, or 
> possibly using the exec trick I outlined in my other message,
> although I have not verified that that actually works.
> 
> Michael
> --
> Michael Peppler       -||-  Data Migrations Inc.
> mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler