# The following was supposedly scribed by # Sisyphus # on Thursday 05 May 2005 01:38 am:
>All works well if I set that environment variable at the command > prompt, by entering: > D:\ghostscript>set GS_LIB=F:\gs\gs8.51\lib;F:\gs\fonts > >But if, instead of doing it that way, I try to do it in the perl > script: >then it doesn't find the files that it needs to find >That shows quite clearly that GS_LIB has been set to the correct value > - but for some reason the environment variable is not visible when it > needs to be. Rob, It's not clear from your post when the variable *needs* to be visible to what. Is some kind of fork happening at startup? Your Inline::C code should be an extension of the perl interpreter, and should therefore have access to all of perl's namespace, be running within the same process, etc. So, if you're calling the function that is supposed to lookup the variable, it should be doing that at run-time and in sequence with the rest of your program. But, if you're calling some kind of init() at startup, maybe that is getting the current value and ignoring your later changes. I'm not familiar with environment variables in C. How does perl create ENV? Is it the same ENV that the underlying C code uses? I.E. what's the difference between _putenv() and putenv() ? Maybe there's something funky in the ghostscript code (like they use a different method to get the environment because (such as asking the parent process?)) --Eric -- The opinions expressed in this e-mail were randomly generated by the computer and do not necessarily reflect the views of its owner. -- Management --------------------------------------------- http://scratchcomputing.com ---------------------------------------------