From: Mike Campbell Date: 2003-06-04T12:13:37+09:00 Subject: Re: case of sub! not working > Which again needs the setenv() call to actually alter the value in the > environment. and it did modify the copy of ENV['PATH'] it made, but it > didn't propagate it back to ENV :) > > ENV['bla'] = "banzai" > `echo $bla` # <-- banzai\n > x=ENV['bla'].sub!(/banzai/, "ayaken") # here the copy is modified, result => x > `echo #{x}` # <-- ayaken\n <<- see, it did modify the copy > `echo $bla` # <-- banzai\n <<- but no setenv() call. Oh lord, now I realize I only half understood what was going on. Do I understand this correctly now? * no method modifies the parents environment (standard unix behavior) * ENV#[]= modifies the ENV contents, and as such the current and any subsequent subprocesses environments through a delegated call to setenv (standard unix behavior, and how perl does it with its %ENV hash) * ENV#[]#sub! DOESN'T modify the actual ENV contents, nor as such any environment; current nor subprocess. ?