From: John Joyce Date: 2007-09-30T11:36:01+09:00 Subject: Re: Newbie needs help getting user input On Sep 29, 2007, at 8:28 PM, Peter Vanderhaden wrote: > I'm trying to learn Ruby and trying to convert a Perl program at the > same time. I need to prompt a user to enter a number to select a > processing option. In Perl, I did it this way: > > # > print STDERR "Enter option: "; > chomp ($option = ); > # > > I've searched the web and several books, but I haven't found anything > that works. It also seems that my system doesn't recognize > "gets". Can > anyone help me out, and maybe post a simple input routine I can > look at? > Thanks.... > -- > Posted via http://www.ruby-forum.com/. > The usual basic thing is: puts "Enter option:" option = gets.chomp If your system isn't recognizing gets, then you've got some other problem that should be fixed before writing much code.