in reply to Re^5: Using STDIN after exec() with ActiveState Perl
in thread Using STDIN after exec() with ActiveState Perl

I know Windows isn't linux, and I know PATH is not LD_LIBRARY_PATH. However I didn't know it was possible to set an environment variable that can be seen by a dynamic library loaded by a perl script without relying on using exec, which is what you meant by "you don't need exec on windows" I guess. If you have any link containing information about how to do that I would be very interested.
  • Comment on Re^6: Using STDIN after exec() with ActiveState Perl

Replies are listed 'Best First'.
Re^7: Using STDIN after exec() with ActiveState Perl
by Anonymous Monk on Jun 21, 2015 at 20:07 UTC
    here you go system $^X, $0 ;
      If I use system then I will end up with tons of perl processes (one for each DLL change).

        If I use system then I will end up with tons of perl processes (one for each DLL change).

        You're already going to get that if you try to use exec -- so do you want STDIN to work or what?

Re^7: Using STDIN after exec() with ActiveState Perl
by Anonymous Monk on Jun 21, 2015 at 20:12 UTC

    dynamically select a specific DLL to load from a perl script without

    What do you mean by that?

    Any "dynamically load a dll" code ought to take an absolute path to said dll

      I use a Perl module built with Swig, which implements the interface with a dynamic library coded in C++. I need to use this module with different versions of the C++ library, so what I do is: set the PATH environment variable according to the desired library version, use exec so that this environment variable is taken into account (it doesn't work otherwise), then require the module generated by Swig
        path is not like ld_library_path, its not cached, you don't need exec trick for it to be seen after perl is started, just change path then load the module, you can use Module::Load / Module::Load