From: "R.. Kumar 1.9.1 OSX" Date: 2010-07-13T14:09:02+09:00 Subject: Re: while loop end action John Crichton wrote: > How can I properly run some actions or a method after my counter/time > has reached it's end and then delete the obj instance? > > Thanks since no one has responded I'll make a quick try... 1. you can always do: myarray = nil 2. Your variables and the print can be local variables inside the method. Use @var only for instance level data. in your case, you do not need the data outside of the method. def method array = [] # or array = Array.new while .... array << "str" end puts array.join(",") end In the above example, array is local data and will be released soon after method is over. If array is very large, and your method is really long, and you do not need array after printing, then you can do "array = nil" after its last use. HTH. -- Posted via http://www.ruby-forum.com/.