From: gotoken@... (GOTO Kentaro) Date: 2001-01-02T04:27:01+09:00 Subject: [ruby-talk:8470] Re: A newbie question (about regexp) In message "[ruby-talk:8469] Re: A newbie question (about regexp)" on 01/01/02, David Alan Black writes: >> str = gets >> break if not str >> str.chop! > >That doesn't do what I think you think it does. Empty strings (let >alone ones with newlines in them :-) are not false in Ruby. > >Try this: > > str = gets.chomp > break if str.empty? It doesn't preserve the specification bacause original version is intended to be quit by hitting `ctrl-d' ;-) -- Gotoken