From: zhoujing@... (TOTO) Date: 2003-01-02T22:49:27+09:00 Subject: Re: ENV.clear Gavin Sinclair wrote in message news:<9095791290.20030102143314@soyabean.com.au>... > On Thursday, January 2, 2003, 2:27:10 PM, TOTO wrote: > > > In that case, I guess I have to copy the content of ENV to a real Hash. Am I right? > > This works (hint: muck around in irb): > > h = {}.update(ENV) > > Pretty nice, eh? > Yes. It is. The update method will return a copy of the new Hash or a copy of the reference of the new Hash? How did you find out? I couldn't find it in the Ruby reference. To be honest, I have a stupid thought originally, before I know I can use update method. I think I should implement an insert method for class Hash to do the same thing. And then I find that it might be impossible to do it with Ruby itself, because the class Hash is implemented in c.