in reply to Avoiding goto

Structured programming (as recommended by Dijkstra in his "Go To Considered Harmful") would want you to write it as:
foreach my $a (@b) { if (!...) { do_something(); if (!...) { do_something_else(); if (!...) { do_something_again(); } } } perform_cleanup(); }
The essence being that each block has exactly one entry, and exactly one exit point.