From: Ian Macdonald Date: 2003-06-04T12:31:28+09:00 Subject: Re: case of sub! not working On Wed 04 Jun 2003 at 11:38:02 +0900, Yukihiro Matsumoto wrote: > In message "Re: case of sub! not working" > on 03/06/04, Ian Macdonald writes: > > |In my program, however, I would have been quite happy to have sub! just > |modify the copy of ENV['PATH'] that it had made, as I wanted to modify > |the path that would be used to find the location of a binary I was about > |to open with popen. I wasn't trying to modify the outside environment, > |just that of my script and any of it children. > > I understand what you feel, but still, environment variables are > entities in the operating system, the outside world from Ruby. You > were trying to modify the environment outside of Ruby, without > knowing. Read Hal's explanation again in [ruby-talk:72787]. I understand your reasoning, but why is = any different to sub! ? If assignment (=) is just a method call with some syntactic sugar thrown in, then why is it that sub! tries to modify the outside environment, while = only modifies the singleton copy? Ian -- Ian Macdonald | Before borrowing money from a friend, System Administrator | decide which you need more. -- Addison H. ian@caliban.org | Hallock http://www.caliban.org | |