473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problem using LD_LIBRARY_PATH in perl script

Hi!

I have a problem using the environment variable LD_LIBRARY_PATH in my
perl script. Everything works fine when I set it at the command prompt
and then runs my perl script like this:

presto1@S0222035> echo $LD_LIBRARY_PATH
/SSW/informix/sdk2.50/lib:/SSW/informix/sdk2.50/lib/esql
presto1@S0222035> ldd
/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix.so
libifsql.so => /SSW/informix/sdk2.50/lib/esql/libifsql.so
libifasf.so => /SSW/informix/sdk2.50/lib/libifasf.so
libifgen.so => /SSW/informix/sdk2.50/lib/esql/libifgen.so
libifos.so => /SSW/informix/sdk2.50/lib/esql/libifos.so
libifgls.so => /SSW/informix/sdk2.50/lib/esql/libifgls.so
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libelf.so.1 => /usr/lib/libelf.so.1
libifglx.so => /SSW/informix/sdk2.50/lib/esql/libifglx.so
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/FJSV,GPUS/lib/libc_psr.so.1

and running

presto1@S0222035> ./ins_rutin.pl presto db-ladd-lan06
presto1@S0222035> echo $?
0

executes without error messages and carries out the expected
operations against the database.

On the other hand, when I have a LD_LIBRARY_PATH like

presto1@S0222035> echo $LD_LIBRARY_PATH
/SSW/informix9.4/lib:/SSW/informix9.4/lib/esql:/SSW/informix9.4/lib/tools

and instead adds a row setting LD_LIBRARY_PATH in the perl script

$ENV{"LD_LIBRARY_PATH"}="/SSW/informix/sdk2.50/lib:/SSW/informix/sdk2.50/lib/esql";

invoking the script gives this

presto1@S0222035> ./ins_rutin.pl presto db-ladd-lan06
install_driver(Informix) failed: Can't load
'/usr/perl5/5.6.1/site_perl/sun4-sol
aris/auto/DBD/Informix/Informix.so' for module DBD::Informix: ld.so.1:
/usr/bin/
perl: fatal: libifsql.so: open failed: No such file or directory at
/usr/perl5/5
..6.1/sun4-solaris/DynaLoader.pm line 206.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where
expected
at ./ins_rutin.pl line 35

Why does this happen?

Some info:

presto1@S0222035> perl -v

This is perl, v5.6.1 built for sun4-solaris

presto1@S0222035> uname -a
SunOS S0222035 5.8 Generic sun4us sparc FJSV,GPUS
/Christian Eriksson
Jul 19 '05 #1
1 9224
c-*****@algonet.se (Christian Eriksson) wrote in message news:<d0**************************@posting.google. com>...
I have a problem using the environment variable LD_LIBRARY_PATH in my
perl script. Everything works fine when I set it at the command prompt
[ but if one...]
...instead adds a row setting LD_LIBRARY_PATH in the perl script Perhaps a required shared library or dll isn't installed where
expected Why does this happen?
When you set $ENV{LD_LIBRARY_PATH} do you do so before (that's
cronologically before, not lexically before) you try to load the
library? (Remember the Perl use() is compile-time).

IIRC on some platforms I think LD_LIBRARY_PATH is read from the
environment as the program loads and subsequent changes are ignored.
This is perl, v5.6.1 built for sun4-solaris


I vaguely recall Solaris is such a platform.

This newsgroup does not exist (see FAQ). Please do not start threads
here.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: PzYon | last post by:
Hey 2gether! I'm trying to execute a PERL script on the web server when the user presses a button in an ASP.NET Web Application using Visual Basic. The most obvious solution for me seemed to be...
1
by: Nathan | last post by:
This may be a basic task to some of you perl guru's, but I have a problem getting a perl script i've written, when executed by httpd, to send out an e-mail. Basically, i have a few variables...
2
by: ANarula | last post by:
I am running into a strange problem. I have perl script which reads the "APPDATA" environment variable, and does some work on that directory. When I a launch this script from Command Prompt, it...
1
by: rahulthathoo | last post by:
Hi, After i finish some amount of computation using a perl script, i need to send out an email to a receipient which can change and is known to the Perl script. Is there a way to call the...
1
by: raghav82 | last post by:
New to perl. c++ file which needs to invoke perl file and provide input for it.how to invoke it.i also want to know setting of environment variable in windows environment using the perl script. i set...
4
by: itzaps | last post by:
I am writing one perl script which will take value from an external file and then append the value to another file. The external file will be in the format like $name=value; $name1=value1; and so...
5
by: tudorbalan | last post by:
I'm a complete beginner in Perl.In fact... I just need a perl script to upload files to server without having to use html <input type="file"> tag. I found a script...it works when I run it in cmd...
2
by: gwigg | last post by:
Hi, am am having a problem with extracting all the data I want using a perl script the data being in a mysql database. The script works fine until row 59101 is reached in the 1st table, anyone aware...
1
by: krus | last post by:
Hi All, I am relatively new to HTML and perl scripts. I am writing a HTML page which has a form. It takes two inputs. Now I want pass these two inputs from the HTML form to the perl script. I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.