From: 7stud -- Date: 2007-11-26T05:28:31+09:00 Subject: Re: entering nil string value through gets Robert Dober wrote: > I would not rely on EOF (D) for interactive input > One data point: using Ctrl-D to enter EOF in interactive input works on mac os x. gets(...) => string or nil ------------------------------------------------------------------------ ... Returns +nil+ at end of file. party = gets if party != nil party = party.chomp if party == 'democrats' puts 'dems' elsif party == 'republicans' puts 'rep' end end -- Posted via http://www.ruby-forum.com/.