develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #31711] embedded perl $ENV{PATH} cannot be changed in instance other than the first

Thread Previous | Thread Next
James E Keenan via RT
May 27, 2013 23:12
[perl #31711] embedded perl $ENV{PATH} cannot be changed in instance other than the first
Message ID:
On Mon May 27 11:23:23 2013, jdb wrote:
> On Sun, May 26, 2013 at 10:19 AM, James E Keenan via RT
> <> wrote:
> > On Fri Sep 24 12:21:12 2004, wrote:
> >>
> >> I have embedded perl in my c program, however I have encountered a
> >> problem where the $ENV{PATH} can only be updated in the first
> >> PerlInterpreter instance.
> [...]
> >> Any ideas, suggestions.  I have tried this on win32 and it works fine.
> >
> > Is there anyone familiar with embedded Perl who could evaluate the
> > problem described in this older ticket?
> This behavior is by design: the POSIX environment is shared by all
> threads in a process, so Perl limits access to the OS level
> environment to the first Perl interpreter instantiated in a process.
> This was done with ithreads in mind, but applies equally to multiple
> embedded interpreters if Perl was compiled with USE_ITHREADS:
> On Windows Perl uses a virtualized environment (PerlHost), which does
> keep per-interpreter copies of things like the environment and the
> cwd, and uses these for spawning subprocesses.
> Implementation of a similar hosting layer for Unix is still a wishlist
> A workaround for embedding might be to compile Perl without
> USE_ITHREADS. I haven't thought through the potential implications
> this might have for running multiple interpreters concurrently in
> different threads in this configuration.
> Cheers,
> -Jan

Thanks for responding, Jan.  I'll take this ticket for the purpose of
closing it in seven days unless we get good arguments to the contrary.

Thank you very much.
Jim Keenan

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About