in reply to Avoiding goto

Probably not the cleanest way, but it's possible to write it as:
foreach my $a (@b) { !... && do {do_something(); 1} && !... && do {do_something_else(); 1} && !... && do_something_again(); perform_cleanup(); }
The do's can be simplified if do_something and do_something_else always return true.