Hi Torsten and Heiko,


Heiko Jansen wrote:
Am Freitag, den 09.01.2009, 10:25 +0100 schrieb Torsten Foertsch:
On Fri 09 Jan 2009, Raymond Wan wrote:
It is possible I'm doing something wrong, but so far, this isn't
working.  And if I replace the $cmd with a Perl script and try to
print out $ENV{LD_LIBRARY_PATH}, there is nothing.
I think you need this one:
http://search.cpan.org/~stas/Env-C-0.08/C.pm

Perhaps also possible: replace the program that gets executed with a
shell script that sets the env param and then does "exec realcmd $@".
Or even more simple: change the command string in your perl script to
something like 'LD_LIBRARY_PATH="..." realcmd'.
Of course that's far less elegant than using Env::C but I believe it
should work.


Thank you both for your replies!  I thought I'd give Env::C.pm a try first and 
yes, worked like a dream!  Thank you for giving me the alternatives, Heiko.

Is there an easy explanation why I needed Env::C?  Part of the documentation for it says, "if 
these variables are set in Perl and the glue code doesn't worry to set them on the C level, these 
variables might not be seen by the C level".  The way this is phrased makes it seem very 
generic.  Does "C level" just mean anything that a Perl script calls?  It could be a 
library in C or an entirely separate program; but basically environment variables that aren't being 
passed from the script to something else (that may or may not be related to C -- could be a java 
program).

Thanks both of you for your help!

Ray


Reply via email to