473,325 Members | 2,480 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,325 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 9209
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.