From: Louis J Scoras Date: 2006-06-24T05:24:13+09:00 Subject: Re: Queston: array.push > Now that I understand that, then why do I need the > "another = gets.chomp" after the storing of the element. Shouldn't > the while statement take care of it, and I already know it doesn't > work, but since it's a loop I'm just confused as to the why it doesn't > work. Because if you look at the code again, I took the "gets" out of the while condition. It's just checking to see what is in the "another" variable. That means you manually have to go and grab the next one before you go to the next iteration. I haven't read the book, so I don't know if you've learned that, in ruby, assignments can be used as an expression. That is to say they return values. Practically that means that you can do this: while (another = gets.chomp) != '' ... # and do stuff with "another" So here's the run-down: "gets" reads a string, and that value is chomped. It then is bound to your local variable "another". At this point, the = itself returns the value it on it's right hand side, which is the string you read in. You check that for the null string and go from there. Hope that helps. -- Lou.