in reply to Avoiding goto

Try:

LABEL1: foreach my $a (@b) { if (...) { next LABEL1; } do_something(); if (...) { next LABEL1; } do_something_else(); if (...) { next LABEL1; } do_something_again(); }continue{ clean_up(); }

BTW, you can't avoid goto's. The best you can do is to cleverly disguise them.