On Jan 3, 2008, at 4:55 AM, Charles Oliver Nutter wrote:
> Not true; try it yourself, it's not a "normal" exception that  
> terminates the loop and bubbles out, it's a "special" exception  
> that ends the loop as though a normal "break" were called. So  
> basically, either the non-exception or exception-based "break" can  
> quietly terminate a loop, but only one is catchable.

I'm probably still missing something but is the problem you are  
seeing being caused by the fact that all your rescue clauses omit an  
explicit exception?  The default is StandardError, which will not  
rescue a SyntaxError:

$ cat break.rb
begin
   while true
     begin
       eval 'break'
     rescue Exception
       puts "inner caught: #{$!.class}"
       raise
     end
   end
   puts 'normal break'
rescue Exception
   puts "outer caught: #{$!.class}"
end

$ ruby-1.9 break.rb
inner caught: SyntaxError
outer caught: SyntaxError

$ ruby-1.8 break.rb
normal break


Gary Wright