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

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
  • Comment on Re^8: Using STDIN after exec() with ActiveState Perl

Replies are listed 'Best First'.
Re^9: Using STDIN after exec() with ActiveState Perl
by Anonymous Monk on Jun 21, 2015 at 20:47 UTC
    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
      Oh indeed you're right, actually it's not for the PATH environment variable that I needed the exec. It's for another environment variable which is used by the C++ library. If I set it with %ENV and I don't use exec, then the C++ library doesn't see it.

        Oh indeed you're right, actually it's not for the PATH environment variable that I needed the exec. It's for another environment variable which is used by the C++ library. If I set it with %ENV and I don't use exec, then the C++ library doesn't see it.

        Which one? :)