On Tue, Oct 30, 2001 at 07:43:20PM -0500, Matthew O. Persico wrote:
> Richard Chen wrote:
....
> > 
> > It looks like the Inline part is not a subprocess of the perl
> > script so that the setting in perl script does not affect how
> > Inline part works. Is there a way to change this?
> > 
> > My main question is:
> >     Is there a way to set LD_LIBRARY_PATH in the perl script
> > when using Inline to interface a C shared library?
> > 
> 
> 
> Don't think so. The LD_LIBRARY_PATH is used by the operating system to 
> marshall up the libraries when the program starts. Dynamic loading may 
> allow you to not have to bring libraries into memory until you need 
> them, but the relationships have to be figured out before the program 
> starts, I think.
> 
> If this were 'C', there might be system calls you could use to 
> accomplish this but I think you are SOL in Perl. Can someone show me I'm 
> wrong?
> 
> But what's the big deal? Put the LD_LIBRARY_PATH statement into 
> /etc/profile and move on, if you are the sysadmin.
> 
> If not,
> 
> $vi foo
> i
> #!/bin/ksh
> export LD_LIBRARY_PATH=yadayadayada
> perl foo.pl
> <ESC>:wq
> 

This is a big deal in many situations. In our case, this script
will be used on web sites which are run on many machines.
Making a shell wrapper is too inefficient. Setting LD_LIBRARY_PATH
in httpd.conf means you have to do it on many machines.

I read the docs more carefully and find out there is indeed a way
around it when using Inline. The trick is to use MYEXTLIB
to explicitly set the locations of the shared library files.
This also makes the program more secure because one cannot fool
the program by setting LD_LIBRARY_PATH.

Thanks for your help.

Richard

Reply via email to