matz / ruby-lang.org (Yukihiro Matsumoto) wrote in message news:<1041323021.224559.4437.nullmailer / picachu.netlab.jp>... > Hi, > > In message "ENV.clear" > on 02/12/31, TOTO <zhoujing / comp.nus.edu.sg> writes: > > |ENV.clear > | > |But it doesn't work, with the error message: > |../env.rb:56: undefined method `clear' for #<Object:0x401d0d28> (NameError) > | > |I thought ENV is a Hash, so clear is defined. However, when I tried: > |puts ENV.type > | > |it turns out ENV is only an Object. > | > | > |However, the Hash function delete(key) is defined for ENV. That is very strange. > | > |Can someone experienced tell me what ENV is? > > ENV is an object that provides Hash-like singleton methods to work as > if it's a String-key hash. > > matz. Thanks, Matz. In that case, I guess I have to copy the content of ENV to a real Hash. Am I right?