----- Original Message ----- 
From: "Sisyphus" <[EMAIL PROTECTED]>
To: "inline" <inline@perl.org>
Sent: Thursday, May 05, 2005 6:38 PM
Subject: Inline::C and Environment Variables


> Hi,
>
> On Windows 2000, perl 5.8.6, I have an Inline::C script that accesses the
> ghostscript dll. For the program to succeed, I need to set the environment
> variable:
> GS_LIB=F:\gs\gs8.51\lib;F:\gs\fonts
>

Thanks (to all) for the replies.

Hadn't thought of setting the variable in a BEGIN{} block - which works
fine - thus flying in the face of *my* expectation. (The variable was
already being set as the first line of the script - after 'use warnings;'.)

I can't think why it needs to be put in a BEGIN{} block - given that's not
necessary with the Win32::API script. But I'll give it some thought. First
reaction is that this is again an instance of Inline not running quite as
seamlessly as I expected.

I gather that _putenv() (which I now no longer need) is just the Windows
equivalent of putenv(). I did find an example of its usage which showed me I
had been using it correctly. I later also ran 'system("set");' in the
Inline::C function just to see that the variable had been correctly set -
and it had.

When I have a quiet moment, I'll take that little Inline::C script and
convert it into an XS module that runs independently of Inline, and see if
the BEGIN{} block is still necessary. Perhaps some of you know already know
what the outcome of that little test will be .... but I just have to see for
myself :-)

Thanks again, guys.

Cheers,
Rob

Reply via email to