From: Patrick Hurley Date: 2006-09-08T21:40:35+09:00 Subject: Re: continuing the next iteration On 9/7/06, YAD wrote: > What's the Ruby equivalent of "next" in Perl or "continue" in C? > Is it possible to continue an outer loop, as in Perl's "next" > with a label argument? > > -- > Yet another Dan > > Try catch/throw, although if you can rework your code into smaller chunks and use a return it is often more readable. catch (:deep_error) do (0..10).each do |i| puts i (0..10).each do |j| puts j throw :deep_error if 2 == j end end end puts "done"