From: Joel Pearson Date: 2012-11-22T08:15:26+09:00 Subject: Re: how to increase variable inside the while loop In your wording, "current" is a variable, but it has nothing assigned to it so it is nil. If you want to show the current value of "i", then just write "puts i". If you want to gather each line for some sort of comparison I'd personally read each into an array with something like "my_array.push" and then compare two arrays afterwards. -- Posted via http://www.ruby-forum.com/.