From: Joshua Ballanco Date: 2008-08-15T10:09:55+09:00 Subject: Re: how exit a block? Greg Willits wrote: > I found a suggestion that says to use return, but this generates a > syntax error Using 'return' will break you out of a method. If you want to use it to break out of a loop, wrap your loop in a method. i.e.: #!/usr/bin/ruby @colors = %w(red blue yellow green) def find_yellow @colors.each do |color| p color return color if color == 'yellow' end end puts "I found #{find_yellow}" HTH, Josh -- Posted via http://www.ruby-forum.com/.