From: Jeff Peng Date: 2010-02-01T15:34:58+09:00 Subject: Re: Workaround for "conflict" between ARGV and gets? 在 2010-02-01一的 13:15 +0900,RichardOnRails写道: > gets looks to ARGV, if populated, for its source of data. That is its > documented behavior. > I changed the script to: dir=ARGV[0] ARGV.clear puts "Delete indicated item [yes, no]" STDOUT.flush response = gets.chomp # doesn't go to STDIN !!! puts case response when /^yes$/i; "Deleting" when /^no$/i; "Quiting" else; "Huh?" end puts "EOJ" It works fine for me. $ ruby pause.rb 323 Delete indicated item [yes, no] yes Deleting EOJ -- Jeff Peng Email: jeffpeng@netzero.net Skype: compuperson