title: How to resume from rescue clause in Ruby?
body: <p>How can I write resuming into loops in Ruby? Here is a sample code.</p>
  
  <pre><code>#!/usr/bin/ruby
  #
  
  a = [1,2,3,4,5]
  
  begin
      a.each{|i|
          puts i
      if( i==4 ) then raise StandardError end # Dummy exception case
      }
  rescue =&gt;e
    # Do error handling here
    next # Resume into the next item in 'begin' clause
  end
  </code></pre>
  
  <p>However, when running, Ruby returns the error message</p>
  
  <pre><code>test1.rb:13: Invalid next
  test1.rb: compile error (SyntaxError)
  </code></pre>
  
  <p>I'm using Ruby 1.9.3.</p>