From: zhoujing@... (TOTO) Date: 2003-01-09T00:34:23+09:00 Subject: prompt Is there a Ruby idiom to do prompting? For example, ../rm.rb: remove `t'? y ? I find it rather troublesome to do that. I have to use something like: def prompt(file) print "#{$0}: remove `#{file}'? " decision = STDIN.getc STDIN.getc # Get rid of the ending "\n" return decision end And it is not that safe in fact. If the user enter "Yes\n", the program will crash. Can someone suggest a better solution? Thanks!