From: Tim Pease Date: 2007-09-07T06:30:08+09:00 Subject: Re: How do I exit my program at any time? On 9/6/07, Helgitomas Gislason wrote: > > The main point I'm trying to get to here is: "Is there any function that > I can put at the beginning or the end, that says my program to exit > whenever I say exit WITHOUT having to put the: > Redefine gets to do what you want ... module Kernel def gets( sep = $/ ) str = super str.chomp! exit if str == 'exit' str end end Or if you are not comfortable with redefining methods in Kernel, write your own gets method ... def gets_and_exit( sep = $/ ) str = gets( sep ) .... end Blessings, TwP