in reply to Win32 Perl fail to see the set ENV in loaded module

By "load a module" do you mean using use module; or require module;? The use happens at compile time. A require on the other hand works at runtime.

Seeing the actual code may be helpful.

Replies are listed 'Best First'.
Re^2: Win32 Perl fail to see the set ENV in loaded module
by kartlee05 (Novice) on Apr 25, 2014 at 18:15 UTC
    I just updated the ticket with the code. 'use' or 'require' seem to be behaving same in this case.

      I don't have Windows handy to test at the moment. It is my suspicion that the DLL is grabbing the environment from somewhere other than the current process. The module itself should be reflecting the current process's environment since it is part of the current process.The BEGIN block shouldn't even be necessary.

      Since you're working with a specific DLL, you may want to check the programmer's documentation for that DLL.

        Hi, I wrote a c program which load the dynamic library using LoadLibrary(..) call. And before doing that, I try to set the environment variable in the program using putenv(..). The dll very well can see the environment variable. I see this is an issue with perl loading the library and the environment it can use. It would be good if someone can confirm so I can file a bug. -Karthik