Jonathan --- wrote:
> I have the following code:
> 
> words = []
> 
> while gets.chomp != ''
>   words.push gets.chomp
> end

Jonathan,

ruby reads another line each time you call gets or gets.chomp (or 
gets.anything). You need to cache the result of the call to gets(). I 
would write:

while line = gets.chomp && line != ""
   words.push line
end

Dan