On 2009-12-09, Ruby Newbee <rubynewbee / gmail.com> wrote: > But when I re-executed x = gets it always got a nil. > Why this happens? Thank you. Because you convinced it that it had reached the end of file, and gets returns a nil after you've reached end of file. -s -- Copyright 2009, all wrongs reversed. Peter Seebach / usenet-nospam / seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!