in reply to $ENV for Threads?

Have you tried doing this ?
sub thread{ local %ENV = %ENV; # ... code ... }

--perlplexer

Replies are listed 'Best First'.
Re: Re: $ENV for Threads?
by Elian (Parson) on Apr 09, 2002 at 17:31 UTC
    That would be... very bad. Don't do it.

    The local localizes a global, but doesn't make it thread-local, so you'll be changing thigns for everyone. (And without locking either, which will definitely Do Bad Things)

    There's no good way which actually uses %ENV. Best thing to do is to either wrap access in an interface of some sort, or copy %ENV to a different hash.

    If you actually need a thread-locak version of %ENV because you're using code you didn't write, well... you're out of luck.