From: ts Date: 2003-08-07T23:32:59+09:00 Subject: Re: Elegant solution for a loop-break problem >>>>> "K" == KONTRA Gergely writes: K> Can I exit more loops with next/last/redo? (like in perl) You have catch, throw K> Is there something similar to python's for .. else ... structure? (Do K> something, ONLY when the loop is terminated normally (without break) You can write something like this svg% cat b.rb #!/usr/bin/ruby for j in 1..2 puts '==================' if for i in 1..2 p i break if j == 1 end p "ok" end end svg% svg% b.rb ================== 1 ================== 1 2 "ok" svg% Guy Decoux