From: ts Date: 2001-08-21T15:44:59+09:00 Subject: [ruby-talk:20043] Re: breaking out of nested loops >>>>> "J" == John Tromp writes: J> print "nomatch\n" unless for i in 0...5 do J> break unless for j in 5...8 do J> if i==j J> print "match\n" J> break J> end J> end J> end Well, you have a problem here : it will print nothing, and if you replace "..." with ".." it will print "match\nnomatch\n" You can, perhaps, use #catch puts (catch(:end) do for i in 0 .. 5 for j in 5 .. 8 throw :end, "match" if i == j end end "nomatch" end) Guy Decoux