From: WATANABE Hirofumi Date: 2003-01-28T16:35:13+09:00 Subject: Re: loop while Hi, Tim Bates writes: > Why can't I do: > > loop while t.gets !~ /[Cc]onnected/ > > Is there a similarly terse but readable way of doing this? I just want to > throw away all input until I reach the 'connected' line (assuming t is a > TCPSocket...) while t.gets !~ /[Cc]onnect/ do end begin end while t.gets !~ /[Cc]onnect/ until t.gets =~ /[Cc]onnect/ do end begin end until t.gets =~ /[Cc]onnect/ loop do break if t.gets =~ /[Cc]onnect/ end If the string 'connected' is fixed, you can specify by the argument of gets. t.gets("connected\n") -- eban