From: Jeremy Hinegardner Date: 2007-11-25T17:11:54+09:00 Subject: Re: Problem getting user input If you do write many scripts that require prompting for user input, you should check out highline http://highline.rubyforge.org/ enjoy, -jeremy On Sat, Nov 24, 2007 at 03:44:59AM +0900, Peter Vanderhaden wrote: > Sebastian, > THANK YOU, THANK YOU, THANK YOU! > The $stdin.gets works perfectly! I really appreciate all you > experienced folks helping out this newbie! I'm going to hilight this > stuff in PickAxe when I get done. > PV > > Sebastian Hungerecker wrote: > > Peter Vanderhaden wrote: > >> If I use gets, the script just prints the prompt and seems to end. > > > > I see in your script that ARGV is not empty. That means Kernel#gets is > > gonna read from the files in ARGV and not from stdin. To rectify that > > use $stdin.gets instead. Or empty ARGV before you call gets. > > > > > > HTH, > > Sebastian > > -- > Posted via http://www.ruby-forum.com/. > -- ======================================================================== Jeremy Hinegardner jeremy@hinegardner.org