Rubyで再開をループに書き込むにはどうすればよいですか? これがサンプルコードです。
#!/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 =>e
# Do error handling here
next # Resume into the next item in 'begin' clause
end
ただし、実行時にRubyはエラーメッセージを返します
test1.rb:13: Invalid next
test1.rb: compile error (SyntaxError)
Ruby 1.9.3 を使用しています。